I have a macro that I run weekly on Fridays through use of the Windows Task Scheduler. It works fine, except for one thing. It is date-based. A table hold certain info, including dates in this format YYYYMM.
My query has the start with 'YYYYMM' and end with 'YYYYMM'.
The parameters are always based as follows:
If the current month is may, the first parameter should be '200206'. Accordingly, the last parameter should be 12 months out or '200305'.
If I remember to go into the query and change the hard-coded date, no problem. It just so happened that 2 weeks ago I forgot to change it on May 1, 2002, Friday. Sure enough, it ran with the parameters of '200205' and '200304'.
My question: How can I use the computer's system date to set these parameters automatically?
Thanks in advance.
My query has the start with 'YYYYMM' and end with 'YYYYMM'.
The parameters are always based as follows:
If the current month is may, the first parameter should be '200206'. Accordingly, the last parameter should be 12 months out or '200305'.
If I remember to go into the query and change the hard-coded date, no problem. It just so happened that 2 weeks ago I forgot to change it on May 1, 2002, Friday. Sure enough, it ran with the parameters of '200205' and '200304'.
My question: How can I use the computer's system date to set these parameters automatically?
Thanks in advance.