Help needed with Month(Now())-1 criteria.

I found another one that will work, do you see any problems associated with this?

Field: Month: DatePart("m",[SAFETY]![RevisionDate])

Criteria:Month(Date())-1
 
To do that you first create a field based on your date field as in

Month([YourDateField]) which will give results from 1 to 12 and then apply your your Month(Date())-1 to the criteria of that field.

How does this handle:
I am building a query the display records for the past month.

The past month will be for only a single year. You code has the potential of returning multiple years, no just the past month..
 
PS,

It produces the dates 1/02/2009 and 28/02/2009 so wonlt won't find 1/2/1966 etc
 
How does this handle:


The past month will be for only a single year. You code has the potential of returning multiple years, no just the past month..

I read past month I guesss in the context of birthdays, policy commencement dates and similar where the month itself is the issue as an anniversary.

Any way, he has everything covered now:D
 

Users who are viewing this thread

Back
Top Bottom