Union Query to a Table

M

miss_mas

I created a union query. How do I get the output to go to a new table?
Do I have to CREATE TABLE then use all the INSERT INTO functions or is there
an easier way to do this? I am creating a new table because I need another
database to be able to link to this table.
 
B

Bob Barrows [MVP]

miss_mas said:
I created a union query. How do I get the output to go to a new
table?
Do I have to CREATE TABLE then use all the INSERT INTO functions or
is there an easier way to do this? I am creating a new table because
I need another database to be able to link to this table.

That's probably the appropriate way if you wish to have keys (indexes),
validation rules, etc.

If you simply wish to have a heap of data, then this should work (it works
in SQL Server anyways):

select <column_list> into newtable from ...
union
select <column_list> from ...
etc.
 
K

Klatuu

Create the table first with the correct field types and lengths. Make Table
queries make assumptions and use defaults that waste memory space.
Create an append query that appends the output of your Union query to the
new table.
 

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