In AC97, I have the following query to return records that have a start date between a forms start and finish date.
Generally it works. However, it doesn't find the record when the start unload date (=[Forms]![frmCarsUnloadedReport]![tbxStartUnload]) and the finish unload date (=[Forms]![frmCarsUnloadedReport]![tbxFinishUnload]) are the same as the date the cars were unloaded
(tblCarsUnloaded.StartUnload).
The start date in tblCarsUnloaded.StartUnload is actually a general date with date/time (mm/dd/yy hh:nn AM/PM), and the date in Forms]![frmCarsUnloadedReport]![tbxStartUnload]is only the date (mm/dd/yy) selected from a calendar control.
I've found that if the finish date [frmCarsUnloadedReport]![tbxFinishUnload]is changed to one day more that the start date, then the record is returned.
Any suggestions on how to also be able to return the record for the train unloaded, when the selected start and end dates are the same as the train unload date?
Thanks,
Brian
Code:
SELECT tblCarsUnloaded.TrainID, tblCarsUnloaded.TrainPartID, tblCarsUnloaded.CarsUnloaded, tblCarsUnloaded.Weight, tblCarsUnloaded.StartUnload, tblCarsUnloaded.FinishUnload, tblCarsUnloaded.CrewSize, tblCarsUnloaded.HandlingOptionNo, tblCarsUnloaded.Notes, tblCarsUnloaded.TStamp, tblTrain.TrainYear, tblTrain.TrainNo, tblHandlingOption.HandlingOptionNo, tblHandlingOption.HandlingOption
FROM (tblCarsUnloaded INNER JOIN tblTrain ON tblCarsUnloaded.TrainID = tblTrain.TrainID) INNER JOIN tblHandlingOption ON tblCarsUnloaded.HandlingOptionNo = tblHandlingOption.HandlingOptionNo
WHERE ((([tblCarsUnloaded].[StartUnload])>=[Forms]![frmCarsUnloadedReport]![tbxStartUnload] And ([tblCarsUnloaded].[StartUnload])<=[Forms]![frmCarsUnloadedReport]![tbxFinishUnload]));
Generally it works. However, it doesn't find the record when the start unload date (=[Forms]![frmCarsUnloadedReport]![tbxStartUnload]) and the finish unload date (=[Forms]![frmCarsUnloadedReport]![tbxFinishUnload]) are the same as the date the cars were unloaded
(tblCarsUnloaded.StartUnload).
The start date in tblCarsUnloaded.StartUnload is actually a general date with date/time (mm/dd/yy hh:nn AM/PM), and the date in Forms]![frmCarsUnloadedReport]![tbxStartUnload]is only the date (mm/dd/yy) selected from a calendar control.
I've found that if the finish date [frmCarsUnloadedReport]![tbxFinishUnload]is changed to one day more that the start date, then the record is returned.
Any suggestions on how to also be able to return the record for the train unloaded, when the selected start and end dates are the same as the train unload date?
Thanks,
Brian