I've been trying to figure this out for a while now and have not got any closer. I get the error:
An expression of non-boolean type specified in a context where a condition is expected, near 'or'.
My SQL query is:
SELECT Pitch.Location_id
FROM PITCH
WHERE (((Pitch.Location_Id) Not In
(SELECT Location_Id FROM BOOKING
WHERE BOOKING.StartDate or BOOKING.EndDate
NOT BETWEEN '2014-06-08' AND '2014-07-08')) AND
((PITCH.Type_name)='Delux') AND ((PITCH.Available)=1))
If I remove the or BOOKING.EndDate, the query works perfectly.
WHERE BOOKING.StartDate NOT BETWEEN '2014-06-08' AND '2014-07-08' or BOOKING.EndDate NOT BETWEEN '2014-06-08' AND '2014-07-08'