15 Feb 2012, 7:01 PM
Zen Follower
- Join Date:
- Feb 2009
- Posts:
- 125
- Plugin Contributions:
- 0
Total cost of inventory in store
Was fiddling with SQL and came up with this quick query to output total cost of all products in the store:
SELECT
/*pd.products_name,
p.products_price,
p.products_quantity,*/
SUM(p.products_quantity * p.products_price) products_cost
/*p.products_quantity * p.products_price products_cost*/
FROM vintageelectronics_products_description pd
INNER JOIN vintageelectronics_products p
ON pd.products_id = p.products_id;
Commented out lines display cost of each product instead of one grand total.
If anyone can give me a quick overview on how to create a report, I'll try to create a similar report by category with grand total at the bottom.