query question

smithrd6

Board Regular
Joined
Dec 13, 2005
Messages
150
I am attempting to link two tables. The second table contains company name unique to a company code contained in table one. Not every entry in table one has the information but I wanted to include it when it does. The first table has 31 rows of information. When I run the query is duplicating records on the order of from 31 original to over 1400. How can I eliminate the duplicates?

thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Could you post your query?

Sometimes simply adding the Keyword DISTINCT is all you need. I.e., in SQL view:

Code:
SELECT DISTINCT table1.companycode, table2.companyname...

This is also available in access by setting query properties | unique values to yes.
 
Upvote 0
Are you creating a join between the 2 tables in your query? If you try to query two tables without a join the result is the product of those tables, kind of sounds like what you're describing.

hth,
Giacomo
 
Upvote 0

Forum statistics

Threads
1,222,102
Messages
6,163,942
Members
451,866
Latest member
cradd64

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