I have recently been tring to model a hotel reservations database I found the following query online it says it is supposed to query my reservations table for available rooms by date:
WHERE Room_Id NOT in (select Room_Id from tblReservations where RequestedStartDate <= EndBookingDate and RequestedEndDate >= StartBookingDate );
Question # 1
I am new to sql parameter queries and what I don't undestand is why I have to input a start bookingdate and an endbookingdate. Shouldn't the user just add the input the requested dates the guest would like to find the rooms available within the time frame
Question # 2
I would like to know if i can insert use this query in a form where the user inserts the request dates via a combo boxes and calendar control, clicks a control button and gets the results in another form.Is this possible using vbcode as well?