A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Duplicated Query results



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2004, 03:49 PM
Alex
external usenet poster
 
Posts: n/a
Default 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  
Old June 1st, 2004, 04:40 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.