Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query multiple tables into a nother table 2

Status
Not open for further replies.

np3il

Programmer
Aug 15, 2002
63
US
Query

Is there a way to read data from more than one table with the same Layouts and append the data as one table?

In better words:

Merging two tables into another table.

Any suggestions are appreciated.

Thanks

Np3il
 
If you have two tables, tbl1 and tbl2, which are of exactly the saem structure and you want to combine them into 1 new table, tblNew, try this:
Code:
SELECT * INTO tblNew FROM (SELECT * FROM tbl1 UNION SELECT * FROM tbl2);
Hope this helps.

[pc2]
 
an append query?

or insert select query?

--------------------
Procrastinate Now!
 
The code put it in prespective but:

Is there a way to do this in MS-Access | Query?

Thanks
np3il
 
switch to the SQL view of a query, paste the SQL, modify to the correct table names, run the query. You'll need this modified SQL probably:

SELECT A.* INTO tblNew FROM (SELECT * FROM tbl1 UNION SELECT * FROM tbl2) As A;

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Thanks for the suggestions it worked very well.

Best Regards

np3il
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top