Hi
Could anyone help please?
I have 2 tables:
TblVehicles
Reg (pk)
Model
Colour
TblReservations
ID (pk)
Reg
ResStartDate
ResEndDate
The tables are joined by the reg fields.
I have an unbound list box and the row source is the following SQL which mainly works great:
SELECT DISTINCT TblVehicles.Reg, TblVehicles.Colour, TblVehicles.Model FROM TblVehicles INNER JOIN TblReservations ON TblVehicles.Reg=TblReservations.Reg WHERE (((TblReservations.ResStartDate) Not Between #5/1/2007# And #5/3/2007#));
The problem I am having is this:
In TblVehicles there are 10 records (i.e. 10 different vehicles.
In TblReservations there are 3 records, 1 vehicle has been reserved once and another vehicle has been reserved twice.
What I want to see in the list box is 9 vehicles because one of them is reserved during the dates in the SQL but instead, wat I am getting is 2 records because it seems to be giving me the records from TblReservations but I need them from TblVehicles as I need to see what vehicles are still available.
I do hope this makes sense and that someone can help!
Thanks in advance
Could anyone help please?
I have 2 tables:
TblVehicles
Reg (pk)
Model
Colour
TblReservations
ID (pk)
Reg
ResStartDate
ResEndDate
The tables are joined by the reg fields.
I have an unbound list box and the row source is the following SQL which mainly works great:
SELECT DISTINCT TblVehicles.Reg, TblVehicles.Colour, TblVehicles.Model FROM TblVehicles INNER JOIN TblReservations ON TblVehicles.Reg=TblReservations.Reg WHERE (((TblReservations.ResStartDate) Not Between #5/1/2007# And #5/3/2007#));
The problem I am having is this:
In TblVehicles there are 10 records (i.e. 10 different vehicles.
In TblReservations there are 3 records, 1 vehicle has been reserved once and another vehicle has been reserved twice.
What I want to see in the list box is 9 vehicles because one of them is reserved during the dates in the SQL but instead, wat I am getting is 2 records because it seems to be giving me the records from TblReservations but I need them from TblVehicles as I need to see what vehicles are still available.
I do hope this makes sense and that someone can help!
Thanks in advance