i am trying to check availability of a room i have the following code:
ALTER procedure [dbo].[CheckAvailability]
@checkIn datetime,
@checkout datetime
as
Select r.RoomName, RoomNO, [Description],Location,
RoomPic, Price from [Room-Type] t , Room r, Booking b
where r.TypeNo= t.TypeNo AND r.RoomName Not IN(
Select b.CheckinDate from Booking b where
(
@checkIn = b.CheckinDate
AND
@checkIn<b.CheckinDate OR
@checkout>b.CheckinDate
OR
@checkIn>b.CheckinDate OR
@checkout<b.CheckinDate
AND
[Status] != 'Booked'
)
)
the problem is now "it only show rooms that are not in the booking table only, wheres i would like to view the rooms in booking table but not between the date range"