Hello,
Has been awhile since last on the forum.
My question, which is probably an easy one but for some reason I just can't figure it out, is my Query has a 'time' column. How can I only show data from NOW to 4 hours prior?
Can someone help?
Hello,
Has been awhile since last on the forum.
My question, which is probably an easy one but for some reason I just can't figure it out, is my Query has a 'time' column. How can I only show data from NOW to 4 hours prior?
Can someone help?
Need the date part or will get all years. Is there also a date field? Try:
WHERE [datefield] & " " & [timefield] BETWEEN DateAdd("h", -4, Now()) AND Now()
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks June7,
Yes I have a date field, aka "Date1" and my time field is "timeatPour"
How would I write this in the criteria
Substitute the dummy field names I used with your real field names.
Can switch the query to SQL view and type the WHERE clause criteria. Then switch to Design view to see the result.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
June7, I get the following error . . .
![]()
WHERE clause goes after the FROM clause.
SELECT ...
FROM ...
WHERE ...;
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks June7, Now I do feel stupid!!!! Works perfectly.
I appreciate all the help you have given me over the years.