Creating table from other tables

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

Guest

I have 12 tables in a database with the same field labels and data types in
each field. I want to create one table combining all 12 of these tables. I
know I can copy/paste the data from each table into this new table, but is
there an easier way?
 
I have 12 tables in a database with the same field labels and data types in
each field. I want to create one table combining all 12 of these tables. I
know I can copy/paste the data from each table into this new table, but is
there an easier way?

Two of them:

1. Run twelve Append queries (or eleven, if you use one of them as the
target table and append the rest of them)

2. An extra step but maybe faster overall:

Create a Query selecting all the fields in one table. Open it in SQL
view (View... SQL, or use the SQL option from the dropdown in the
leftmost toolbar button). You'll see somethingl like

SELECT this, that, theother, whatever FROM TableA;

Edit the SQL to create a UNION query:

SELECT this, that, theother, whatever FROM TableA
UNION ALL
SELECT this, that, theother, whatever FROM TableB
UNION ALL
SELECT this, that, theother, whatever FROM TableC
UNION ALL
SELECT this, that, theother, whatever FROM TableD
UNION ALL


<etc. etc. through all 12 tables>

This query will string together all the tables; you can save it, and
then create an Append query based on it to append all the records into
a new, empty table.

John W. Vinson[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

Back
Top