I am trying to create a query that will return records by a given date and time range. The query thus far is as follows:
SELECT DISTINCT Orders.ApprovalDate
FROM Orders
WHERE Orders.ApprovalDate Between #11/21/2004 15:0:0# And #11/22/2004 14:59:59#)
This works just fine. The problem is I want to run this query daily with out any parameters so it will return records with an approval date between 2 days prior, after 3pm and 1 day prior, up to 2:59. As above...I would run that query on the 23rd...at any time during the day.
Thoughts?
SELECT DISTINCT Orders.ApprovalDate
FROM Orders
WHERE Orders.ApprovalDate Between #11/21/2004 15:0:0# And #11/22/2004 14:59:59#)
This works just fine. The problem is I want to run this query daily with out any parameters so it will return records with an approval date between 2 days prior, after 3pm and 1 day prior, up to 2:59. As above...I would run that query on the 23rd...at any time during the day.
Thoughts?