Missing tables in Union query

G

Guest

I have separate data bases for each of 25 countries. Each database has
identical taables TT1 thru TTx. where x is 6 to 10 I want to write one
single SQl statement Union select or Append to create a single table in each
data base. If I use a

Select *.TT1
....
Union Select *.TT10

it errors out for missing tables. is there a way to ignore the missing
tables.
 
J

Jeff Boyce

If you really are "learning" (and I'd have to say from your description, it
is the hard way), then consider a different data structure.

You could make your task a lot easier (and get more use out of the features
and functions of Access) if you normalized your data.

Even if you can't control the way the data comes to you, you could still
consolidate it into a much more usable form.

First, are you saying that tables TT1 through TTx are "identical tables"
(i.e., same structure, different data)? If so, there's a really good chance
that these could be combined into a single table! Perhaps something like:

SingleTable
RowID
YourFirstField
YourSecondField
...
Your_nth_Field
YourTableValue

If you are using multiple (identical) tables, you are possibly putting data
into the name of the table, rather than into a field in a table ... hence
the "YourTableValue" (this could even be your "1" through "x").

Second, if you have multiple countries, each with their own database, why
not combine the data into a single table. To the above table, add one more
field, i.e.

YourCountryValue

Of course, I may have totally misunderstood what you were describing...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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