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

Multiple records not needed in query

Status
Not open for further replies.

Gustavo

Technical User
Nov 3, 2000
16
0
0
US
Unclear as to what I am doing wrong. HELP! Example of what I am doing.

SELECT DISTINCT PCMS_PCMS_CHDOC_DATA.CH_UID AS Num_ID, DimGrpLkup.lkup_trans
FROM PCMS_PCMS_CHDOC_DATA INNER JOIN DimGrpLkup ON PCMS_PCMS_CHDOC_DATA.PRODUCT_ID = DimGrpLkup.lkup_product
WHERE (((PCMS_PCMS_CHDOC_DATA.CREATE_DATE)>=#6/17/2006#) AND ((PCMS_PCMS_CHDOC_DATA.SEQ)=1));

I have two tables "CHDOC_DATA.PRODUCT_ID" and "GpLkup.lkup_product". When I include another column like "Lkup.lkup_trans" from the second table I get multple records. What is up?
 
Is lkup_product the PrimaryKey of DimGrpLkup ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
No it is not the primary key. It contains duplicate entries in that column. I tried making it primary but Access does not like that.
 
So, for each record of PCMS_PCMS_CHDOC_DATA you get all the records of DimGrpLkup having lkup_product=PRODUCT_ID

You may find the following of interest:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top