View Single Post
  #9  
Old March 16th, 2010, 09:07 PM posted to microsoft.public.access.gettingstarted
Robbie
external usenet poster
 
Posts: 58
Default Duplicate showing in query when there shouldn't be

I have the same problem with Duplicates in my query. My table that the query
is based on is linked to a text file with no way that I know of to set the
primary key. any suggestions?

Here is my SQL code...

SELECT [Physical Count].Date, [Physical Count].SKU, dbo_Products.Inv_Lvl1,
dbo_Inv_Level_1.Name, dbo_Products.Inv_Lvl2, dbo_Inv_Level_2.Name,
dbo_Products.Inv_Lvl3, dbo_Inv_Level_3.Name, [Physical Count].Description,
[Physical Count].[Book Quantity], [Physical Count].[Book Amount], [Physical
Count].[Actual Quantity], [Physical Count].[Actual Amount], [Physical
Count].[Quantity Variance], [Physical Count].[Amount Variance]
FROM (((dbo_Products LEFT JOIN dbo_Inv_Level_1 ON dbo_Products.Inv_Lvl1 =
dbo_Inv_Level_1.Inv_Lvl1) LEFT JOIN dbo_Inv_Level_2 ON dbo_Products.Inv_Lvl2
= dbo_Inv_Level_2.Inv_Lvl2) LEFT JOIN dbo_Inv_Level_3 ON
dbo_Products.Inv_Lvl3 = dbo_Inv_Level_3.Inv_Lvl3) INNER JOIN [Physical Count]
ON dbo_Products.SKU_Number = [Physical Count].SKU;


Thanks in advance.
Robbie


"Fred" wrote:

I sure that this is just a less expert way of saying what Karl already said,
but, each of your relationship lines has to have a "no duplicates" field at
one end of it. 99% of the time the "no duplicates" field is a Primary Key
field, and making it a primary key is a way to automatically prevent you from
entering duplicates.

Violating this is the most common cause of your problem.