Jump to content

'Available dates' logic


loquela

Recommended Posts

I've got a logic puzzle that has got me completelly foxed and I would REALLY appreciate some help.

 

I am working on a room availability date checker. I have a table 'booked_rooms' with four fields:

 

 

id

room_id

arrival_date

departure_date

 

I am trying to figure out the select statement that will list all the rooms that are available on and between between two given dates.

 

Any takers?  ???

 

Many thanks in advance.

 

S.

 

 

Link to comment
Share on other sites

What format is '$arrival_date' and $departure_date' in?

 

You can do something like:

 

SELECT * FROM table WHERE date_field BETWEEN '$arrival_date' AND '$departure_date';

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.