开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜