I have a database which records vehicles passing through a weighbridge and records the date and time of weighing.
What I am trying to do is create a query which shows all vehicles that have been weighed between two dates and times.
What I have so far is select blah from blah WHERE (((tblTicketDetails.TDate)>=[Forms]![FrmTransactionRptParameters]![TxtFromDate] And (tblTicketDetails.TDate)<=[Forms]![FrmTransactionRptParameters]![TxtToDate]) AND ((tblTicketDetails.TTime)>=[Forms]![FrmTransactionRptParameters]![TxtFromTime] And (tblTicketDetails.TTime)<=[Forms]![FrmTransactionRptParameters]![TxtToTime]));
However the results returned are not correct.
I would like for example to show all the vehicles that were weighed between:-
From Date 01/01/2004
From Time 10:00
To Date 10/01/2004
To Time 15:00
The results I am getting are all Vehicles that were weighed between 01/10/2004 and 10/01/2004 providing they did not get before 10:00 and after 15:00.
Any help is greatly appreciated.
Thanks
Taff
What I am trying to do is create a query which shows all vehicles that have been weighed between two dates and times.
What I have so far is select blah from blah WHERE (((tblTicketDetails.TDate)>=[Forms]![FrmTransactionRptParameters]![TxtFromDate] And (tblTicketDetails.TDate)<=[Forms]![FrmTransactionRptParameters]![TxtToDate]) AND ((tblTicketDetails.TTime)>=[Forms]![FrmTransactionRptParameters]![TxtFromTime] And (tblTicketDetails.TTime)<=[Forms]![FrmTransactionRptParameters]![TxtToTime]));
However the results returned are not correct.
I would like for example to show all the vehicles that were weighed between:-
From Date 01/01/2004
From Time 10:00
To Date 10/01/2004
To Time 15:00
The results I am getting are all Vehicles that were weighed between 01/10/2004 and 10/01/2004 providing they did not get before 10:00 and after 15:00.
Any help is greatly appreciated.
Thanks
Taff