Combining duplicates in different queries

D

Dustin

Hi,

I have two queries with the same Part No. One query is what the dealer
ordered and the other is what the dealer told us he sold. How do I make a
query that puts the same part no's from the two together and then give me the
final quantity of what he has left of those parts?

Is this possible thanks,

Dustin
 
A

Aaron Kempf

it's called a union query


select firstname from employees
union
select firstname from customers


this would get rid of the duplicates
 
J

John W. Vinson

Hi,

I have two queries with the same Part No. One query is what the dealer
ordered and the other is what the dealer told us he sold. How do I make a
query that puts the same part no's from the two together and then give me the
final quantity of what he has left of those parts?

Is this possible thanks,

Dustin

I'm sure that it is, but since you haven't given any indication of the nature
of these queries or how this "final quantity" might be calculated, I can't
really say how.

Try creating a new query joining these two queries on Part No and do an
appropriate calculation. If each query has only one record for each part no
this should work. You may need to use a Left Outer Join (select the join line
and choose the option "show all records in Ordered and matching records in
Sold") if you might have some parts where there were orders but no sales.

John W. Vinson [MVP]
 
Top