IT
 strSQL = "exec daycount " + Session("grade") + ",'" + Session("police") + "','" + AToDay + "'"

CREATE Procedure daycount
@Grad int,
@police Varchar(10),
@currenttime varchar(20)

as
if @Grad=0
begin
select (select hotelname from info_hotel where info_hotel.hotelcode=Info_Guest.hotelcode) as hotelname,Count(guestcode) as UpDataNum from info_Guest where substring(LoginTime,1,8)=@currenttime and hotelcode in (select PH.hotelcode from Info_hotel as PH where PH.ting=@police and hotelstatus = 1) group by HotelCode  ORDER BY UpDataNum
end
  
GO

posted on 2009-08-06 17:12  liufei  阅读(185)  评论(0编辑  收藏  举报