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

How to combine 2 tables with 3 columns each to 1 table with 6 columns? 1

Status
Not open for further replies.

inso18

Technical User
Dec 30, 2006
147
IL
Hello users and experts.

I'm exporting 2 text tables from 2 different sources into 2 access tables - table1 and table2. I want to be able to combine those access tables into a one table in the following way:

table1:........table2:.........target_table:
c1.c2.c3......d1.d2.d3......c1.c2.c3.d1.d2.d3
1..4..7........2..4..5.........1..4..7..2..4..5
2..5..4........5..3..1.........2..5..4..5..3..1
3..2..2........2..7..4.........3..2..2..2..7..4

Can you help?
inso18
 
Assuming the two tables have the same number of records:

1. Add a new Autonumber field to both tables. Make it the primary key.

2. Create a Make Table query with SQL along the lines of:

Code:
SELECT Table1.F1, Table1.F2, Table1.F3, Table2.LinkID, * INTO TargetTable FROM Table1 INNER JOIN Table2 ON Table1.LinkID = Table2.LinkID;

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks for the technique. It works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top