Not sure we are talking the same... So, I have a due date field. Let's say the due date is 6/1/2021. I would like to return records that are 30 days before the due date. So it would be 5/1/2021. Does that make sense?
Kitty
Yes we were talking about the same thing.
Your initial post suggested records where due date was 30 days from today rather than some specified due date.
Here's a slightly modified version of what I gave before including the condition added by @CarlettoFed to ensure past order dates are excluded.
The will list any orders where the due date is within the next 30 days
Code:
...WHERE DueDate Between Date() And Date()+30
But...now you appear to have muddled things slightly.
Let's say the due date is 6/1/2021. I would like to return records that are 30 days before the due date. So it would be 5/1/2021. Does that make sense?
On what basis are those records selected. There would need to be some other date field e.g. order date / completion date / despatch date?
If so, you need to modify the Date() function to use the other field concerned instead
You should carefully consider the process if you are looking for a date that is exactly 30 days from today. Usually, you would be looking at something in a date range or older/newer than a given date or perhaps in a range with a specific status.