A family of Microsoft relational database management systems designed for ease of use.
PS: Should you ever have occasion to something like this in a 'totals' query you should select 'where' in the 'total:' row.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a field that has an order date (order_date) and I want to see if today's date is more than 21 days from the order date. We want to make a report that shows all orders that are 21 days old so we can call the customer with an update. Do I add the calculation in a query criteria? I did create a query.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
PS: Should you ever have occasion to something like this in a 'totals' query you should select 'where' in the 'total:' row.
21 days or more
.... WHERE DateDiff("d", Date(), order_date) = 21 will work only on the exact day (if order_date contains a time portion, only at the exact same time within a few milliseconds). To get records at OR LATER than the same order date you need to use
.... WHERE DateDiff("d", Date(), order_date) >= 21
Do you want ONLY records where the difference is exactly 21 days?
Or would you include records where the difference is 21 days or more?
Your criteria will be:
.... WHERE DateDiff("d", Date(), order_date) = 21