I run a report EVERY 2 weeks. I'm using a query as the source of the report. The report is Date driven. Is there a way to implement in the query itself a method to retrieve the Current month? In other words, I generally run the reports from the 1-15th of the month and the 16-31. Instead of manually changing the date parameter in the query from BETWEEN 1/1/2008 - 1/15/2008 TO 1/16/2008 - 1/31/2008, could this be automated?? Also, could the same thing be done for the month and year for that matter?
Perpetual Date Change In a Query
Collapse
X
-
Tags: None
-
You'll want to investigate the DatePart() function. For example:
will return 2, as the current month of the current date.Code:DatePart("m", Date)
Opening the vba code window in Access, (Alt+F11) and typing this into the immediate window (Ctl+G) then pressing F1 will open the topic specific help file which gives you all (or the majority) of the things you can do with this function.
Regards,
Scott
Comment