Hi All I've managed to get somewhere with the query below with some help but it has a small problem after rigorous testing I found there is a small glitch e.g. Let’s say if I book from 10:00 to 13:00 and someone tries to book it from 08:00 to 21:00 (all day) IT WILL BOOK, meaning it will over lap. I have tried to sort it but failing miserably, anyone with any thoughts Thanks Zed SELECT b_id, COUNT(*) AS Cnt FROM booking WHERE request_date='$request_date' AND ( ($s_time >= s_time AND $s_time < e_time) OR ($e_time > s_time AND $e_time <= e_time) ) GROUP BY b_id Code (markup):
Thanks everyone I've managed to sort it, this is what it looks like SELECT COUNT(*) AS Cnt FROM booking WHERE request_date = '$request_date' AND $e_time > s_time AND $s_time < e_time