By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,671 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,671 IT Pros & Developers. It's quick & easy.

Running same query acrosss multiple tables

P: n/a
I've got a database with about 300,000 records. There are several
different tables that are set up the same way with identical fields. I
have the same queries individually set up for each table. Is there a
way to just set the query once and then run it across several tables or
tell the query which table to run it on. Some of the queries are just
select queries, some are append, and some are update. Thanks.

Apr 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
well, if you run the queries as SQL strings in VBA (instead of query objects
in the database window), you can easily loop through a collection of the
table names, using each one in a given SQL string, in turn. i have to ask,
though: why do you have multiple identical tables? that suggests that you
are using table names to store data (a month? a "type" of something?) in
separate groups. suggest you consider normalizing your data by putting it
all in one table, with a field to designate which "group" each record
belongs to. if you're not familiar with normalization principles, i strongly
recommend you read up on the subject before proceeding further. see
http://home.att.net/~california.db/tips.html#aTip1 for more information.

hth
<fo*******@martecgroup.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
I've got a database with about 300,000 records. There are several
different tables that are set up the same way with identical fields. I
have the same queries individually set up for each table. Is there a
way to just set the query once and then run it across several tables or
tell the query which table to run it on. Some of the queries are just
select queries, some are append, and some are update. Thanks.

Apr 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.