Click here to Skip to main content
15,917,568 members

Comments by Member 15542389 (Top 1 by date)

Member 15542389 21-Feb-22 4:30am View    
I dont think its the group by statement because i dont get an error and i do receive the data i expect, its just not correct.

I have added the data to make it more clear. So lets say i want to make a new reservation with the startdate being on 2016-01-01. The query checks if that date is taken (which it is on reservation id 1 and 2) and it wont return those rooms as available. But on reservation 4 and 5 the new reservation date 2016-01-01 does not fall between those dates so it will still return the rooms even though they are not available. So i want a query that checks if all the records from a certain room are clear so it will return a room only if there is no reservation on the new date 2016-01-01