Duplicate Values ???

wisemank

Board Regular
Joined
Jun 21, 2010
Messages
129
I have 12 tables (specific years( 2006, 2007, 2008..)) and within each year table there are 2 columns containing Part number & VSC. I am trying to gather every part number and its corresponding VSC from each of the tables without any duplicates. Not sure if query or script will work best. Any ideas?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Create a query from one of the tables that returns the Part and VSC numbers only.
Then changes this to a Union Query, adding all the code from all the other tables.

Do do this, after you create the first query, switch to SQL View. Highlight and copy all the code up to the semi-colon.
Then, just before the semi-colin, type a space, then the word "UNION", then another space, then paste the code you copied.
Now, in the code you just pasted, alter it to reference the next table (change table names).
Then repeat the steps above until you have added a UNION for each table. By nature of UNION queries, all the duplicates should be surpressed (just be sure NOT to include the year field!).

Here is a little write-up on Union Queries, if that helps: Combine the results of several select queries by using a union query - Access

Note, if your database was normalized, this would be very easy to do. In a normalized set up, you would only have one table like this (instead of one for each year), and you would have a year field in your table. So all the years records would be in a single table (in a normalized database, you would not have multiple data tables containing the same structure).
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top