-
Access - sum
Hello,
I'm from Poland and I;m so sorry for my english.
I have a little problem with acces, i don't know how to do 1 thing.
I have database where I have:
ProductID (for example "114", "128" etc.)
Year (2006, 2007...)
Quarter (Q1, Q2, Q3, Q4)
Ammount (for example 1222, 2, 4 123...)
Now I would like to create new table so I create new query and add:
ProductID
Year (select just 2006)
Quarter (just Q1)
Ammount
And now I would like to add evry ammount for ProductID "114" after to product ID "128" etc
For example I have:
ProductID - Ammount
114--------------22
114--------------8
114--------------3
128--------------3
128--------------1332
128--------------1
128---------------21
And I would like to see it in new table:
ProductID - Ammount
114---------33
128---------1357
Hope, somebody help me.
Kacper
-
Hi,
try the following below - replacing table1 with the your correct table name an make sure your field names are also changed if they are not "Amount" and "ProductID"
Enter this into a new query in SQL view (create - query design - ignore "show table dialogue box, just close it and select SQL view - top left corner (hopefully))
SELECT Table1.ProductID, Sum(Table1.Amount) AS SumOfAmount
FROM Table1
GROUP BY Table1.ProductID;
(you can click Datasheet View to see what this query looks like if you had have set it up in the grid)
If you want to make a table out of your results, change this Totals Query to a Make Table Query and run it -
hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules