Union query to add duplicate records together

J

Jeff

I have an Union query which looks like the following:

SELECT ALL *
FROM [order Details]

UNION SELECT ALL *
FROM[Order Details Labor]
ORDER BY [OrderID];

I want the query to add together any duplicate records for
the same ORDERID

The Fields are OrderID, ProductID, Quantity, UnitPrice and
Line Total

So I want to add the quantities together and the LIne
total.

Example

ORDERID PRODUCTID QUANTITY UNITPRICE LINETOTAL
2000 Comb 1 $5.00 $5.00
2000 Comb 1 $5.00 $5.00


Result wanted:

2000 Comb 2 $5.00 $10.00


Thank you for any help that you can give me.

JEff
 

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