Hi to all,
I am developing a booking system .I have problem to get records .
Scenario is.
I have a database table where i define two fields arrival_date and departure_date.
I have a calendar when i move to month beneath the calendar i am showing all records of that month.
My query is
SELECT * FROM roombooking
WHERE arrival_date between ‘2010-05-01’ and ‘2010-05-31’ or departure_date between ‘2010-05-01’ and ‘2010-05-31’
it show me all records whose arrival_date or departure_date is between ‘2010-05-01’ and ‘2010-05-31’
For example if a person book a room with arrival_date is ‘2010-04-01’ and departure date is ‘2010-06-01’
this records should also come in month of may because month of may is between april and june .
kindly help me
regards