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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining two tables with similar information into one table.

Status
Not open for further replies.

JDows

MIS
May 6, 2002
4
US
Ok, here is my problem. I have two tables that hold the exact same information for different departments. (All of the fields are the same, but each record is unique between both tables. There are no crossovers so I don't think right/left join will work) What I would like to do is just stack each table on top of each other into a thrid table or query.

Example Just to clarify:
Table 1 has 4 records, all unique.
Table 2 has 4 records, all unique (even from table 1)

I want table 3 to have all 8 records.

This should be really easy, but I can't figure out how to do it in Access or SQL. Please help.
 
You need to develop a UNION query to do this. The UNION query recordset could then be taken into a Make-table query to finish out the process.

If you need help with creating a UNION query just post back.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Here is an example of a UNION query:

Code:
Select A.* FROM table1 as A 
UNION ALL 
Select B.* from table2 as B

Code:
Select C.* from [i][red]qryUnionQueryName[/red][/i] as C INTO [i][blue]newtablename[/blue][/i];



[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top