Hey all,
i have two fields in a booking table, one called arrival date and the other called departure date. I need to check if a user inputted date falls within those two fields ranges.
arrival departure
-----------------------|------------------------
2006-11-10 13:00:00 2006-11-21 13:00:00
This is all I have but obviously this will not work because the departure date is in a range that is not. What I'd like to do, is determine if the date falls in the range of the arrival and departure date.
BTW, don't worry about how the date gets input. That's taken care of using PHP.
i have two fields in a booking table, one called arrival date and the other called departure date. I need to check if a user inputted date falls within those two fields ranges.
arrival departure
-----------------------|------------------------
2006-11-10 13:00:00 2006-11-21 13:00:00
Code:
SELECT COUNT(booking.BOOKINGS_UNID) FROM booking WHERE booking.PROPERTY_ID=654 AND booking.ARRIVAL>='2006-11-15 00:00:00' AND booking.DEPARTURE <= '2006-11-15 23:59:59'
This is all I have but obviously this will not work because the departure date is in a range that is not. What I'd like to do, is determine if the date falls in the range of the arrival and departure date.
BTW, don't worry about how the date gets input. That's taken care of using PHP.