Duplicated Query results

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have two tables; "Orders" & "Cancellations". The Orders
table contains the following orders:
part# loc
1 a
3 b
1 a
5 d


The Cancellations table contains the following
cancellations:
part# loc
1 a
3 b
4 d

I'm trying to create a query that will give me only the
cancellations that have the same part# & loc in the
table. I make a query containing both tables with join
lines at Part# & loc. The query successfully leaves out
cancellation part# 4 because there is no part#4 oreder in
the Orders table. But, the query results lists part#1
twice, because there are 2 records in the orders table for
part# 1.

Since I'm trying to query a valid list of cancellations, I
don't want 2 records with Part#1 when there is only 1
Part# 1 cancellation. Can you please tell me what I'm
doing wrong?

Many thanks,
Alex
 
You should restrict the columns in the SELECT statment to
only those from the Cancelations table to avoid the
duplications from the Orders table.

Hope This Helps
Gerald Stanley MCSD
 
Back
Top