I am doing the function of booking a hotel, when I get the rooms available by date by following
SELECT *
FROM oder
WHERE
startDate >= '2020-12-26 06:53:18.114+00' AND
endDate <= '2020-12-30 06:53:18.114+00'
but it works when i enter the exact start and end date stored in the database, i want when i enter the start and end date time can be within the period stored in the database, I can also get the room that was booked.
example: I choose the startDate = 2020-12-27 and the endDate=2020-12-28is within the period of 2020-12-26 to 2020-12-30, I want the result to return like the above query
SELECT *
FROM oder
WHERE
startDate >= '2020-12-26 06:53:18.114+00' AND
endDate <= '2020-12-28 06:53:18.114+00'