Report based on current month

Khushalay

Registered User.
Local time
Today, 05:04
Joined
Apr 16, 2016
Messages
180
I want to generate three reports each based on current month, previous month and the next month.
The report is based on a query so what criteria/condition shall I put in the query to achieve the desired reports.

Thanks in advance.
 
In a report form,
Put a combo for the current month.(and year)
Another box for previous. When user picks the current, the AFTERUPDATE event can update the previous month.

The queries will read these settings off the form.
 
Im sorry, I didnt get it. I want three different button that is: Current Month, Previous Month and Next Month and they should open the respective reports. I have an extensive data ranging more than these three months. How to filter the specified records only.

I guess something need to be given in the query criteria.
 
Thanks. I got it worked.
Used
WHERE Month(MillenniumDeliveryDate) = Month(Date());
 
That won't work once you have data from over a year old, you'll get anything with month 10 in it.
 
Yes, I have year condition as well but for now this is easy.
 
Why not use the code I linked to it's guaranteed to work whenever you run it. e.g. This will pull everything from the previous month. Even when you run it in January.
Code:
Year([YourDate])* 12 + DatePart("m", [YourDate]) = Year(Date())* 12 + DatePart("m", Date()) - 1
 

Users who are viewing this thread

Back
Top Bottom