Previous Month in query

  • Thread starter Thread starter programmingrookie
  • Start date Start date
P

programmingrookie

I have a date field "reportdate" set to a short date format. I want to pull
the month and year of the previous month as a criteria for a query. For
instance, for January 2008, I want to pull all records from December 2007.
Any ideas would be greatly appreciated.
 
In design view add a calculated field like this ---
Report_Month: Format([YourDateField], "yyyymm")

In criteria for the field use ---
Format(DateAdd("m", -1, Date()), "yyyymm")
 
Back
Top