hotel check in & check out time is
Table data
check in check out room name
2018-09-17 11:00:00 2018-09-19 11:00:00 room 1
2018-09-18 11:00:00 2018-09-19 11:00:00 room 2
Note : Standard Check in and Check out time : 11:00 AM
if i try for date from 2018-09-17 11:00:00 to 2018-09-18 11:00:00
then output for that date total booked should be 1.
room 1 is booked and room 2 should be free.
my query
SELECT * FROM transcationmaster WHERE checkin >= STR_TO_DATE('2018-09-17 11:00:00', '%Y-%m-%d %H:%i:%s') and checkout <= STR_TO_DATE('2018-09-18 11:00:00', '%Y-%m-%d %H:%i:%s')
how to do this in mysql?
Thanks in advance