how to select record in given dates
i have a table named rooms_booked and field is:
id, room_id, check_in_date, check_out_date.开发者_开发百科
how can i search those record which is booked between to given dates
say i want to search those record which is booked between 16-04-2011 to 19-04-2011.
thanks in advance
Try using following query:
SELECT * FROM rooms_booked WHERE check_in_date BETWEEN '16-04-2011' AND '19-04-2011'
SELECT * FROM rooms_booked
WHERE check_in_date BETWEEN '16-04-2011' AND '19-04-2011'
Using BETWEEN
精彩评论