I am trying to select arrival dates and departure date to find a match between alredy booked dates from a database.
The query is this:
Select Arrival, Departure from RoomBooking where
Arrival between vararrival and vardeparture OR
Departure Between vararrival and vardeparture AND vardeparture Between Arrival and Departure OR
vararrival Between Arrival and Departure AND
RoomNumber = varrmnumber
This seems to pick up any room within the criteria and not the filter for RoomNumber.
if anyone can spot the error i would be very pleased!
I can't see the wood for the trees, is one expression that comes to mind.
Cheers!
The query is this:
Select Arrival, Departure from RoomBooking where
Arrival between vararrival and vardeparture OR
Departure Between vararrival and vardeparture AND vardeparture Between Arrival and Departure OR
vararrival Between Arrival and Departure AND
RoomNumber = varrmnumber
This seems to pick up any room within the criteria and not the filter for RoomNumber.
if anyone can spot the error i would be very pleased!
I can't see the wood for the trees, is one expression that comes to mind.
Cheers!