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

Combining Tables

Status
Not open for further replies.

taylornow

Technical User
Oct 16, 2000
90
US
Hello everybody-
I have 5 different tables, all with the same fields, that I need to combine into one big table. There will be duplicates due to the fact that some on one list belong to another list. They want all of them together on one table. What is the best way to combine and catch the duplicates at the same time ?

Thanks in advance.

Taylor
 
I'm thinking that if you create a new table with a primary key established, then do append queries for both tables, when you run the second append query, the duplicate values will not be appended.

If you already have a primary key set up on one of the tables, you could just append the other table and once again, it will not append duplicate primary key values.

Or a more elegant way would be to use a union query, which by default, does not include duplicate records.
Mike Rohde
rohdem@marshallengines.com
 
Try a UNION query and make a table out of the result set. I would then ferret out the duplicates by a 'Find Duplicates' query for that table.

Its not the "same time" concept you requested, but that's how I would do it. You could try saving a step by merging or making an overlapping query.

Gary
gwinn7
 
Each of the tables has a primary key set up ( all formatted the same way ). And something else --- what the heck is a union query ???

thanks again in advance

Taylor
 
Do a search for UNION in the help menu. If you have primary keys set up, you could try just appending one table to the other. It will not append duplicate primary key values.
Mike Rohde
rohdem@marshallengines.com
 
Thanks you guys. Mike - I went to the help and I am now going to give it a go ! I didn't mean to sound silly with the query thing. I just had never had to use that one. Thank goodness for you guys and that wonderful help button.

Here I go ---

Taylor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top