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
LVL 4
Slim81Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
I would expect this should work:

for an individual item
SELECT SUM(Prod_Qty) FROM Order_Details WHERE prod_sku = 3013

Or
SELECT Prod_SKU, SUM(Prod_Qty) FROM Order_Details GROUP BY Prod_Sku
(I'll check this, I think that's it... my SQL is a little rusty).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
muratkanikCommented:
just update your sql query as below and then you will get the attached result

SELECT sum(prod_qty), Prod_sku
  FROM [KatkiDB].[dbo].[order_details] group by Prod_sku
result.JPG
0
muratkanikCommented:
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_details] group by Prod_sku
0
Slim81Author Commented:
You are a pro!  Awesome!  I used the second option.  Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.