I have spreadsheet reports I generate for some clients on a weekly basis. Each report shows the activity for the previous week. I've built VBA that can run the query and send the report, but I'm hitting a major performance problem with regards to the query itself. If I manually enter the week number into the query, I get my results within a minute or two. But A) I want to make the process completely automated and B) the week changes 52 times a year.
If I set the week number I want into a local table (as the only record) and do an inner join to the activity table (which is on a network server and holds millions of records), it takes hours to run and i'm pretty sure it rechecks the local table as it parses through each record in the activity table. How can I set my query to look up the correct week each time it is run, but without having to look it up for each record?
I'm on access 2007. Thanks.
If I set the week number I want into a local table (as the only record) and do an inner join to the activity table (which is on a network server and holds millions of records), it takes hours to run and i'm pretty sure it rechecks the local table as it parses through each record in the activity table. How can I set my query to look up the correct week each time it is run, but without having to look it up for each record?
I'm on access 2007. Thanks.