I have a table with two products (currently) "petrol" & "diesel"

------------------------------------------------------------------------------------

ID Product_iD Product Original_amt Draw Outstanding

1 101 Petrol 1200 100 0

2 102 Diesel 3000 50 0

3 101 Petrol 1200 150 0

4 101 Petrol 1200 200 0

------------------------------------------------------------------------------------

I bought $1200 of Petrol and $3000 for the Deisel.

As time goes, i draw them down for private use.

------------------------------------------------------------------------------------

My question:

I'd like to see the "sum of total draw-down" of each product.

------------------------------------------------------------------------------------

Therefore, my desired result should look like this:

product_id product Total_Draw_Down

101 Petrol 450

102 Diesel 50

------------------------------------------------------------------------------------

Thank you so much, experts ! ^_^!

--

Allen Phailat Wongakanit

Hi Allen

product_id product Total_Draw_Down

Try the following SQL...

select product_id, product, sum(draw_down) as total_draw_down

from TableName

group by product_id, product

hth

Andy Hull

product_id product Total_Draw_Down

Try the following SQL...

select product_id, product, sum(draw_down) as total_draw_down

from TableName

group by product_id, product

hth

Andy Hull

1. Calculated field question sum of a product rather then the product of sums

5. sum product sum if conditional HELP!!!

6. Need Help with a Sum of a Product of a Currency and Product

7. separating product terms from sum-of-products (symbolic)

8. summing values according to name in defferent column

9. Look up value according to Mapping and Sum up values macro

10. How do i sum values according to specific value from other field?

11. Summing up subtotals according to conditions

12. To sum according to cells color

13. Sum according to font colour

14. How to SUM data according CG Groups.

15. sum of a column according to two or more variables

2 post • Page:**1** of **1**