This is a continuation of the thread here:
So I have the query below:
CourtesyCarBookings.BookingId_Fk not in
on a.CalendarDateId = b.ID
b.CalendarDate between '01-03-2021' and '02-03-2021')
AND courtesyCarBookings.CourtesyCarId_Fk = CourtesyCarModels.CourtesyCarId
The intention is to return cars free for a date. So the calendar table would store dates (basically every day of the year). If a car is reserved on a date (let's say 8-9 March), but another car is not, and a customer wants to book a car for 8-9 March, the booked car will not return in the query, but a car which is free.