G
Guest
Thanks for taking the time to read my question.
I am trying to build a query that will return info based on a Start and End
Date as well as a Start and End Time.
If the user types in (on a form):
Start Date: 1-3-05
End Date: 2-3-05
Start Time: 08:00
End Time: 10:00
I only get info for both days between 8 and 10 am.
What I would like to get is info between 8:00 on March 1st and 10:00 on
March 2nd.
How do I build my query to get that?
Thanks again for your help.
Brad
My SQL stmt:
SELECT tblFeedRecords.MixerDTCode, tblFeedRecords.MixerDTMins,
tblFeedRecords.LotNumber, tblFeedRecords.ProductCode,
tblFeedRecords.ProductName, tblFeedRecords.CustomerName,
tblFeedRecords.Tonnes,
IIf(IsNull([tblFeedRecords]![BinNumTwo]),[tblFeedRecords]![BinNumOne],[tblFeedRecords]![BinNumOne]
& " / " & [tblFeedRecords]![BinNumTwo]) AS Bin,
tblFeedRecords.MixerStartTime, tblFeedRecords.MixerStopTime,
tblFeedRecords.Medication, tblFeedRecords.MixerInitial,
IIf(IsNull([tblFeedRecords]![LoadOutBinTwo]),[tblFeedRecords]![LoadOutBinOne],[tblFeedRecords]![LoadOutBinOne]
& " / " & [tblFeedRecords]![LoadOutBinTwo]) AS LoadOut,
tblFeedRecords.MixRecComplete, tblFeedRecords.MixerDate,
tblFeedRecords.AutoFlush
FROM tblFeedRecords
WHERE
(((tblFeedRecords.MixerStartTime)>=[Forms]![frmRPTGenerator]![StartTime]) AND
((tblFeedRecords.MixerStopTime)<=[Forms]![frmRPTGenerator]![EndTime]) AND
((tblFeedRecords.MixRecComplete)=True) AND ((tblFeedRecords.MixerDate)
Between [Forms]![frmRPTGenerator]![StartDate] And
[Forms]![frmRPTGenerator]![EndDate]));
I am trying to build a query that will return info based on a Start and End
Date as well as a Start and End Time.
If the user types in (on a form):
Start Date: 1-3-05
End Date: 2-3-05
Start Time: 08:00
End Time: 10:00
I only get info for both days between 8 and 10 am.
What I would like to get is info between 8:00 on March 1st and 10:00 on
March 2nd.
How do I build my query to get that?
Thanks again for your help.
Brad
My SQL stmt:
SELECT tblFeedRecords.MixerDTCode, tblFeedRecords.MixerDTMins,
tblFeedRecords.LotNumber, tblFeedRecords.ProductCode,
tblFeedRecords.ProductName, tblFeedRecords.CustomerName,
tblFeedRecords.Tonnes,
IIf(IsNull([tblFeedRecords]![BinNumTwo]),[tblFeedRecords]![BinNumOne],[tblFeedRecords]![BinNumOne]
& " / " & [tblFeedRecords]![BinNumTwo]) AS Bin,
tblFeedRecords.MixerStartTime, tblFeedRecords.MixerStopTime,
tblFeedRecords.Medication, tblFeedRecords.MixerInitial,
IIf(IsNull([tblFeedRecords]![LoadOutBinTwo]),[tblFeedRecords]![LoadOutBinOne],[tblFeedRecords]![LoadOutBinOne]
& " / " & [tblFeedRecords]![LoadOutBinTwo]) AS LoadOut,
tblFeedRecords.MixRecComplete, tblFeedRecords.MixerDate,
tblFeedRecords.AutoFlush
FROM tblFeedRecords
WHERE
(((tblFeedRecords.MixerStartTime)>=[Forms]![frmRPTGenerator]![StartTime]) AND
((tblFeedRecords.MixerStopTime)<=[Forms]![frmRPTGenerator]![EndTime]) AND
((tblFeedRecords.MixRecComplete)=True) AND ((tblFeedRecords.MixerDate)
Between [Forms]![frmRPTGenerator]![StartDate] And
[Forms]![frmRPTGenerator]![EndDate]));