Slim81
asked on
asp recordset loop?
Hey guys,
I have a database that has a few fields, you can see them in the image I provided below. I am hoping there is some magic code available to loop through the recordset, counting the quantities of each sku.
I was hoping to be able to count the quantity of each sku.
I hope that makes sense!
Untitled-1.gif
I have a database that has a few fields, you can see them in the image I provided below. I am hoping there is some magic code available to loop through the recordset, counting the quantities of each sku.
I was hoping to be able to count the quantity of each sku.
I hope that makes sense!
Untitled-1.gif
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you would like to have a column name you can use it as
SELECT sum(prod_qty) as total_quantity, Prod_sku
FROM [KatkiDB].[dbo].[order_det ails] group by Prod_sku
SELECT sum(prod_qty) as total_quantity, Prod_sku
FROM [KatkiDB].[dbo].[order_det
ASKER
You are a pro! Awesome! I used the second option. Thanks!
SELECT sum(prod_qty), Prod_sku
FROM [KatkiDB].[dbo].[order_det
result.JPG