Help! - Using Last 12 months in a query

KYLE_DELUCA

Registered User.
Local time
Today, 00:42
Joined
Mar 20, 2003
Messages
11
I have started building a select query which works well, but I would like my date field to only return records within the past 12 months. What do I put in the criteria that will always filter for records that are within the last 12 months.


Thanks for your assistance

Kyle Deluca
 
>= DateAdd("yyyy", -1, Date())
 
Last edited:
Thanks very much for your assistance!

Kyle Deluca
 
Look up the DateAdd function in the help files to get the exact syntax you want. The idea is that if your table contains a proper date field for the events, and that date field is the one on which you wish to base your filter, you might be able to do something like a DateAdd("m", -12, Now) - but make sure you read the text of what that "m" does for you. It might not be exactly what you wanted.

Anyway, if you make a selection criterion such that the event date from your record must be greater than the computed DateAdd function that is 12 months prior to Now(), that is one way to approach it.
 
Rolling 12-month or past 365 days?

I am curious, are you looking to

1) Enter July 15, 2003, and return all records from
July 14, 2002 to July 15 2003?

OR

2) Pick a month/year, e.g. July 2003 and return all records from
June 2002 to July 2003?
 

Users who are viewing this thread

Back
Top Bottom