how do you merge tables?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have around 20 tables containing similar data. i need to create a querie
that will allow me to compile all of this data together in one table.

any ideas?
 
Is the data structure similar or the same?

If the structure is the same, then you could probably use a UNION query (with 20
tables, this may fail) and then use that to append to a table. Or just use the
UNION Query if you wish. It won't be updatable, but if you don't need that
capability - you won't miss it.

Otherwise, I would say build a table with the structure you need and run 20
append queries.
 
how would i setup a union query? i cannot seem to find a wizard for it.

The wizards aren't smart enough. They're really not all that clever.

It's simplest to create a simple Select query in the query grid using
one of your tables; then select View... SQL, or choose SQL on the
dropdown at the left of the toolbar. You'll see something like

SELECT this, that, theother FROM yourtable1;

Edit this manually to

SELECT this, that, theother FROM yourtable1
UNION ALL
SELECT this, that, theother FROM yourtable2
UNION ALL
SELECT this, that, theother FROM yourtable3
UNION ALL
SELECT this, that, theother FROM yourtable4
UNION ALL
<etc>


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top