Multiple unions

D

Dan

I have the following query in my Access 2007 database, and it is working fine.

SELECT A.ProductID, A.Description, A.Quantity, B.Quantity
FROM Query1 AS A LEFT JOIN Query2 AS B
ON A.ProductID=B.ProductID
UNION SELECT B.ProductID, B.Description, Null, B.Quantity
FROM Query1 AS A RIGHT JOIN Query2 AS B
ON A.ProductID = B.ProductID
WHERE A.ProductID IS Null;

I now want to add a third quantity field (C.Quantity from Query3) to the end
of the field list. I want a similar union as above, so that I have one line
(or record) per product ID where one or more quantity fields for that product
ID are not null. I cannot figure out how to do this. Any help would be
appreciated.
 

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