-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Sampath_Kumar
Message 2 in Discussion

Hi Prem ,   I think you need to change your Tables like this :   Rooms : RoomId , 
RoomName BookedRooms : RoomId , FromDate (DateTime) , ToDate (DateTime)   Create 
Function IsEmpty ( @RoomID int , @FromTime DateTime , @ToTime DateTime ) Returns int 
As 
Begin
 Declare @Booked int , @RVal int 
 Set @Booked = 0
 Select @Booked = Count(RoomID) From BookedRooms Where  RoomId = @RoomID And (Not ( 
(FromTime > @ToTime) Or (ToTime < @FromTime) ) )
 If @Booked > 0 
  Set @RVal = 0
 Else
  Set @RVal = 1 
 Return @RVal
End   Create Procedure GetRooms ( @FromTime DateTime , @ToTime DateTime ) As
Begin
 Select RoomID , RoomName   From Rooms Where dbo.IsEmpty ( RoomID , @FromTime , 
@ToTime ) = 1 
End     And there you go      Regards Sampath

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to