Sum up by cust w all details

H

hoachen

Table Data
CustID Item# ItemName Amount
123 A11 Abc 11.5
123 A13 cde 10
123 A16 fgh 20.5
111 A11 Abc 11.5
111 A16 fgh 10

Output example
123 A11 Abc 11.5
123 A13 cde 10
123 A16 fgh 20.5
42

111 A11 Abc 11.5
111 A16 fgh 10
21.5


I am trying to get it the total of each customer which will look like above
example on Access 2003
I can group it by CustID and the amt but when I make it display on Item# and
itemName the total sum will not group together anymore
I've tried using form or report but unsucessful. Anyone have the solution
which will display like the output example?

Thanks for everyone try to help.
 
K

KARL DEWEY

This places the total at the top of each but if you either use another query
or in a report you could get it the way you want.

SELECT hoachen.CustID, hoachen.[Item#], hoachen.ItemName,
Sum(hoachen.Amount) AS SumOfAmount
FROM hoachen
GROUP BY hoachen.CustID, hoachen.[Item#], hoachen.ItemName
ORDER BY hoachen.CustID, hoachen.[Item#], hoachen.ItemName
UNION ALL SELECT hoachen.CustID, Null, Null, Sum(hoachen.Amount) AS
SumOfAmount
FROM hoachen
GROUP BY hoachen.CustID, Null, Null
ORDER BY hoachen.CustID;
 
H

hoachen

Thank you very much for your solution. Yup, i tried another solution like
create another but it kind of troublesome. This solution work great.

Thanks again

KARL DEWEY said:
This places the total at the top of each but if you either use another query
or in a report you could get it the way you want.

SELECT hoachen.CustID, hoachen.[Item#], hoachen.ItemName,
Sum(hoachen.Amount) AS SumOfAmount
FROM hoachen
GROUP BY hoachen.CustID, hoachen.[Item#], hoachen.ItemName
ORDER BY hoachen.CustID, hoachen.[Item#], hoachen.ItemName
UNION ALL SELECT hoachen.CustID, Null, Null, Sum(hoachen.Amount) AS
SumOfAmount
FROM hoachen
GROUP BY hoachen.CustID, Null, Null
ORDER BY hoachen.CustID;

--
Build a little, test a little.


hoachen said:
Table Data
CustID Item# ItemName Amount
123 A11 Abc 11.5
123 A13 cde 10
123 A16 fgh 20.5
111 A11 Abc 11.5
111 A16 fgh 10

Output example
123 A11 Abc 11.5
123 A13 cde 10
123 A16 fgh 20.5
42

111 A11 Abc 11.5
111 A16 fgh 10
21.5


I am trying to get it the total of each customer which will look like above
example on Access 2003
I can group it by CustID and the amt but when I make it display on Item# and
itemName the total sum will not group together anymore
I've tried using form or report but unsucessful. Anyone have the solution
which will display like the output example?

Thanks for everyone try to help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top