I am trying to make a SQL statement for a project I am working on. It should return all
Rental(rentId, customerId, vehicleId, startdate, enddate, cost)
WHERE vehicles.size= "van"
AND vehicles.vehicleId <>
WHERE (rental.startdate BETWEEN '2016-04-27' AND '2016-04-30')
OR (rental.enddate BETWEEN '2016-04-27' AND '2016-04-30' ))
You didn't quote your dates, so they're not dates - they're math expressions:
rental.enddate BETWEEN 2016-04-27 AND 2016-04-30
executes as if it was "2016 minus 4 minus 27":
rental.enddate BETWEEN 1985 AND 1982
They should all be quoted:
rental.enddate BETWEEN '2016-04-27' AND '2016-04-30'