ActivityID | ActivityDate | ActivityDesc | ProductID | OrderNum | Ordered | Received | Used | SupplierID
I need to make a query so I can subtract the Used from the Received, and group the results by the ProductID so I can see what I have onhand for all products. This is what I have so far. Can someone please help me with this?
SELECT ( SELECT sum(Received)
- ( SELECT sum(Used)
) AS Onhand