mysql> select * from corfu44_reservations; +----+--------+-----------+-------+---------------------+---------------------+-------------+-----------+----------+--------+--------+----------+----- --------+-------------+ | id | car_id | client_id | agent | start_datetime | end_datetime | start_place | end_place | contract | price1 | price2 | babyseat | boos terseat | remarks | +----+--------+-----------+-------+---------------------+---------------------+-------------+-----------+----------+--------+--------+----------+----- --------+-------------+ | 7 | 1 | 1 | agent | 2011-04-11 00:00:00 | 2011-04-16 00:00:00 | | | test | 10 | 20 | yes | yes | test remark | +----+--------+-----------+-------+---------------------+---------------------+-------------+-----------+----------+--------+--------+----------+----- --------+-------------+ 1 row in set (0.00 sec) mysql> SELECT id FROM corfu44_reservations WHERE (str_to_date('2011-04-11 10:00:00','%Y-%c-%d %H:%i:%s') BETWEEN start_datetime AND end_datetime) OR ( str_to_date('2011-04-12 12:00:00','%Y-%c-%d %H:%i:%s') BETWEEN start_datetime AND end_datetime) AND car_id = 1 -> ; +----+ | id | +----+ | 7 | +----+ 1 row in set (0.00 sec)