#  Other Applications & Softwares  > Access Tables & Databases >  > [SOLVED] Combining Two Identical Tables

## keithfender

Hello again,

I am trying to create a master table in Access of two very large excel files. One is for information from 2010 (about 250K rows in Excel) and the other is for information from 2011 (about 300K rows in Excel). 

At first I tried to append the first table with the data from the second one. It didn't work. I'll try to recreate the error message I got so I can post it here. In the meantime, I now have two tables in Access, "2010" and "2011." Is there a way to create a join table where I just combine the two?

I will eventually be using the one table in Access to run pivot tables in Excel.


Thanks in advance,

Keith

----------


## alansidman

If the tables are structured exactly the same you can join the two tables using a UNION query.  Same number of fields in the same order and having the same format for the data.

If the above is the case, then your SQL statement would look like this




```
Please Login or Register  to view this content.
```


Change the table names to match yours.

----------


## keithfender

> If the tables are structured exactly the same you can join the two tables using a UNION query.  Same number of fields in the same order and having the same format for the data.



Alan,

Thanks for the advice. They are identical as far as columns/fields are concerned. Being the extreme Access beginner that I am, could you please tell me where/how to enter that SQL code to create this Union table? I am running Access 2010. I really appreciate you responding to my post.

Keith

**EDIT** Alan, I figured out how to create a Union Query for the two tables. My problem right now is that when I try to select an external source of data for a pivot table in Excel, I can't choose the new query as my source. I only see the two original tables as available sources. Any advice?

----------


## alansidman

Open the query designer.  Close the pop up that asks what tables you want to add.  In the upper left corner the drop down will change from a datasheet icon to SQL.  Click on the SQL.  Insert the code I gave you making the changes to the table name.  Run the query.  Save the query.  You can now export the query results to EXCEL as a combined table.

Alan

----------


## keithfender

Alan, I don't want to bring the raw data back into Excel. It is too many rows. Excel doesn't like Union queries as sources of external data for my pivot table. So... I just ran a normal query bringing everything over from the union query and that worked fine. I now have an Excel file with a pivot table pulling from my query in Access. Thank you very much for your help!

----------

