Macro Several 'Make-Table' Queries without Warning Messages

W

whrogers

I have 25 'Make-Table' queries that take 5 to 6 hours each to finish. I'd
like to create a simple Macro that will run each query without the two
warning messages associated with 'Make-Table' queries so that the computer
will continue working over night and on the weekends. 'Open Query' commands
don't remove the warnings so I'd still need to check on my computer every 5
to 6 hours.

Thank you,
 
S

Steve Schapel

Whrogers,

Try putting a SetWarnings/No action before the first of the OpenQuery
actions.

Any idea why the queries are taking so long to run?
 
W

whrogers

I'll try that this weekend.

The queries are counting the number of foreclosures within a distance and
within a time period for every house sale. So it must calculate the distance
from every sale to every foreclosure and then count those within the proper
distance. I have 150,000 sales observations and 15,000 foreclosures.

Below is the general code I'm using.

SELECT sales.saleID, LAST(sales.dateStamp), COUNT(projects.dateStamp)
FROM sales LEFT JOIN projects
ON sales.dateStamp >= projects.dateStamp
AND sales.x >= projects.x - dist
AND sales.x <= projects.x + dist
AND sales.y >= projects.y - dist
AND sales.y <= projects.x + dist
AND (sales.x-projects.x)^2 + (sales.y-projects.y)^2 <= dist ^2
GROUP BY sales.saleID

I'm open to any suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top