Hotel Booking dates subquery

From: Scotty <invallid_at_invalid.spam>
Date: Sat, 09 Nov 2002 00:17:30 +0000
Message-ID: <5dkosuog0v9698ei9juhfbm2pull0nqqn2_at_4ax.com>



Im looking for a way to find empty rooms hotel between a certain date.

The room has four possible states; reserved, checked in, checked out, cancelled.

Now i'm not sure of the correct syntax but are the mechanics correct?

table with rooms id's -> Rooms
table with bookings -> Bookings

Select room_id
from rooms
where room_id !=

	((select room_id
	from booking
	where room_status= reservation 
	and room_status= checked_in 
	and room_id =)
		(select room_id 
		from booking
		where date between start and finish))

Does that look about right? Received on Sat Nov 09 2002 - 01:17:30 CET

Original text of this message