Duplicated Query results

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
 
G

Gerald Stanley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top