Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query

Status
Not open for further replies.

Gazmysta

Technical User
Sep 4, 2003
18
GB
Hi, Just wondering if anyone can help? Im tryin to work out the total value of stock we have using a query on a table e.g

Quantity Price
62 4.95
12 3.00
43 6.72

How much stock value we have?

Thanks
 
SELECT SUM(Quantity * Price) AS StockValue FROM MyTable

To list the value per stock item,

SELECT ItemID, SUM(Quantity * Price) AS StockValue FROM MyTable GROUP BY ItemID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top