Hi,
I have these 3 tables
Product
+-----------+-------------+----------------------+
| ProductID | ProductName | ProductStandardPrice |
+-----------+-------------+----------------------+
Uses
+------------+-----------+------------------+
| MaterialID | ProductID | QuantityRequired |
+------------+-----------+------------------+
RawMaterial
+------------+-----------------------+
| MaterialID | MaterialStandardPrice |
+------------+-----------------------+
Uses.ProductID = Product.ProductID
Uses.MaterialID = RawMaterial.MaterialID
I want to calculate the total cost for each product. Each product uses certain quantity for each material used and each material has standard price.
So I should get
+-----------+----------------------+-----------+
| ProductID | ProductStandardPrice | TotalCost |
+-----------+----------------------+-----------+