Hello Experts,
I have a query (actually many different ones) but for now, just this one that must be ran every month. It finds activity codes from users which are then exported to Excel and finally copied to a separate Excel spreadsheet which has pivot tables and pivot charts to display what happened during the previous month of operations.
What I would like to do is have this query automatically executed at a given time. For instance, the last query (see below for SQL cut from Access) was for the date range of
3/1/2008 to 3/31/2008 and was ran sometime during the first week of April.
Can I make this automatically run for April (4/1/2008 to 4/30/2008) on May 1st and save the results as an exported Excel spreadsheet (97-2003, .xls format)? Then have it continue to run month after month (next would be 5/1/2008 to 5/31/2008) on June 1st, etc, for ever?
My level of skill in Access is definitely beginner, I just use it to create and run stored queries, but am more than willing to learn and really want to!
SELECT dbo_CONTHIST.LASTUSER, dbo_CONTHIST.ACTVCODE, dbo_CONTHIST.RESULTCODE, dbo_CONTHIST.ONDATE, dbo_CONTACT1.KEY1, dbo_CONTACT1.KEY2, dbo_CONTACT1.KEY3, dbo_CONTACT1.KEY5, dbo_CONTACT1.COMPANY, dbo_CONTACT1.CONTACT, dbo_CONTACT1.SOURCE, dbo_CONTHIST.REF, dbo_CONTHIST.NOTES
FROM dbo_CONTACT1 INNER JOIN dbo_CONTHIST ON dbo_CONTACT1.ACCOUNTNO = dbo_CONTHIST.ACCOUNTNO
WHERE (((dbo_CONTHIST.ACTVCODE)=
"AAI" Or (dbo_CONTHIST.ACTVCODE)="A
AX" Or (dbo_CONTHIST.ACTVCODE)="A
GA" Or (dbo_CONTHIST.ACTVCODE)="C
CL" Or (dbo_CONTHIST.ACTVCODE)="C
OM" Or (dbo_CONTHIST.ACTVCODE)="L
PA" Or (dbo_CONTHIST.ACTVCODE)="N
GA") AND ((dbo_CONTHIST.ONDATE) Between #3/1/2008# And #3/31/2008#))
ORDER BY dbo_CONTHIST.ACTVCODE, dbo_CONTHIST.RESULTCODE, dbo_CONTHIST.ONDATE;
P.S., I will not be able to respond for 8 hours or so (going to bed in a few minutes)!
Thank you,
Kevin
Start Free Trial