If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Duplicated Query results
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 |
#2
|
|||
|
|||
Duplicated Query results
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 -----Original Message----- 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 . |
Thread Tools | |
Display Modes | |
|
|