staffsalex
IS-IT--Management
Hi, Im currently building a vehicle rental website.
Im workin on a query which is trying to select potential vehicles for reservation but only if it satisfies some certain characteristics:
1) it must be held at the branch (ive been using BranchID = 1 for test purposes)
2) it must be of a certain make and model (ive been using MakeModelID = 3 for test purposes)
3) the query must EXCLUDE those vehicles currently reserved. For this I've been using NOT BETWEEN Collect_Date AND Return_Date.
Table Vehicle
VehicleID Registration MakeModelID BranchID
1 AE02 FWC 3 1
2 DY53 WAJ 3 1
Table Reservation
ReserID CustID VehicleID Collect_Date Return_Date
1 1 1 2007-04-04 2007-04-11
I need a query that will show both AE02 FWC and DY53 WAJ if the user selects:
* 3 for the MakeModelID
* 1 for the BranchID
* 2007-04-12 for the collect date
And only show DY53 WAJ if the collect date was for example 2007-04-09.
Any help would be much appreciated. Thanks. Alex
Im workin on a query which is trying to select potential vehicles for reservation but only if it satisfies some certain characteristics:
1) it must be held at the branch (ive been using BranchID = 1 for test purposes)
2) it must be of a certain make and model (ive been using MakeModelID = 3 for test purposes)
3) the query must EXCLUDE those vehicles currently reserved. For this I've been using NOT BETWEEN Collect_Date AND Return_Date.
Table Vehicle
VehicleID Registration MakeModelID BranchID
1 AE02 FWC 3 1
2 DY53 WAJ 3 1
Table Reservation
ReserID CustID VehicleID Collect_Date Return_Date
1 1 1 2007-04-04 2007-04-11
I need a query that will show both AE02 FWC and DY53 WAJ if the user selects:
* 3 for the MakeModelID
* 1 for the BranchID
* 2007-04-12 for the collect date
And only show DY53 WAJ if the collect date was for example 2007-04-09.
Any help would be much appreciated. Thanks. Alex