I am trying to create a report totalling up data for 'last month's' data input. I would like to be able to run this report at any time in the month without affecting the data collected (initially I tried using DataAdd, but found that it only collected data a month prior to the current date).
I have created a query and I'm having problems with the criteria section of the Date field.
This is the criteria I am using: Month(Now())-1
This works fine for all months apart from January, so bearing this in mind I created the If statement
IIf(Month(Now())-1=0, x ,Month(Now())-1)
The question is what to let x become in order to roll the year and month back to December 2001 (in this case).
Is there an easy way to collect 'last month's' data without any impact on when the query is run?
Any help would be greatly appreciated.
Anthony
I have created a query and I'm having problems with the criteria section of the Date field.
This is the criteria I am using: Month(Now())-1
This works fine for all months apart from January, so bearing this in mind I created the If statement
IIf(Month(Now())-1=0, x ,Month(Now())-1)
The question is what to let x become in order to roll the year and month back to December 2001 (in this case).
Is there an easy way to collect 'last month's' data without any impact on when the query is run?
Any help would be greatly appreciated.
Anthony