I have a table set up with like this
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?
Code:
SELECT ( SELECT sum(Received)
FROM InventoryActivity
)
- ( SELECT sum(Used)
FROM InventoryActivity
) AS Onhand