Question Very Simple Column Total

laqa

Registered User.
Local time
Today, 20:27
Joined
Nov 2, 2002
Messages
10
Hi, I have a very simple question about merchandise stock. I have 3 tables, product, incoming_item and sold_item. Database is normalized and attached. Incoming_item and sold_item both have an attribute quantity. I need a query that sums all quantities incoming and subtract sold so I can have product stock. When I check sum in both columns of the query, it sums more than once the quantities of Incoming_item, as number of lines in incoming_item is smaller than in sold_item.

Thank you.

Luis.
 

Attachments

This is a case where you can do 3 queries - 1 each to get the totals for each table and one to bring them together. I'm enclosing your sample with the changes.
 

Attachments

Excellent.

Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom