totals for multiple fields

N

newbeginnings

I have a query that groups by import agent, then sums the number of fields
that are with in a specified date range. I now need to total all of these
fields that are grouped by agent into a graph report. I have been working on
the query to get it to show the total before creating the graph. Here is the
SQL for the query:
SELECT [IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].[IMPORT AGT], Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual
field totals].[CountOfPAPS NO]) AS [SumOfCountOfPAPS NO], Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].[CountOfOTHER PAPS NO])
AS [SumOfCountOfOTHER PAPS NO], Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT
individual field totals].CountOf3) AS SumOfCountOf3, Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].CountOf4) AS
SumOfCountOf4, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf5) AS SumOfCountOf5, Sum([IMPORT AGENT ASSISTANT QUERY FOR
REPORT individual field totals].CountOf6) AS SumOfCountOf6, Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].CountOf7) AS
SumOfCountOf7, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf8) AS SumOfCountOf8, Sum([IMPORT AGENT ASSISTANT QUERY FOR
REPORT individual field totals].CountOf9) AS SumOfCountOf9, Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].CountOf10) AS
SumOfCountOf10, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf11) AS SumOfCountOf11, Sum([IMPORT AGENT ASSISTANT QUERY FOR
REPORT individual field totals].CountOf12) AS SumOfCountOf12, Sum([IMPORT
AGENT ASSISTANT QUERY FOR REPORT individual field totals].CountOf13) AS
SumOfCountOf13, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf14) AS SumOfCountOf14, Sum([TOTALS]) AS Expr1
FROM [IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field totals]
GROUP BY [IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].[IMPORT AGT];


it works fine up to the point that I want to have the grand total for the
individual agents. I have tried:
Nz([count of no of paps no_Label],0) + Nz([count of no of other paps
no_Label,0 + Nz([count of 4]) + Nz([count of 5]) + Nz([count of 6]) +
Nz([count of 7]) + Nz([count of 8]) + Nz([count of 9]) + Nz([count of 10]) +
Nz([count of 11]) + Nz([count of 12]) + Nz([count of 13]) + Nz([count of 14]))

in the criteria field for the expr1 field. this did not work. When trying
to run the query I would be asked to input the date range and then the totals
amount. I do not want to input the totals amount I want the query to give it
to me. I have also tried =[count of no of paps no_Label] + [count of no of
other paps no_Label] and so on. this did not work either. If you have a
suggestion please let me know. I will continue to research.
 
N

newbeginnings

i forget to state that I have also tried to come up with the totals for each
agent by using a form and placing a text box in the header. I have not had
success with this either. I am having trouble writing the information for
the control source.

newbeginnings said:
I have a query that groups by import agent, then sums the number of fields
that are with in a specified date range. I now need to total all of these
fields that are grouped by agent into a graph report. I have been working on
the query to get it to show the total before creating the graph. Here is the
SQL for the query:
SELECT [IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].[IMPORT AGT], Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual
field totals].[CountOfPAPS NO]) AS [SumOfCountOfPAPS NO], Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].[CountOfOTHER PAPS NO])
AS [SumOfCountOfOTHER PAPS NO], Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT
individual field totals].CountOf3) AS SumOfCountOf3, Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].CountOf4) AS
SumOfCountOf4, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf5) AS SumOfCountOf5, Sum([IMPORT AGENT ASSISTANT QUERY FOR
REPORT individual field totals].CountOf6) AS SumOfCountOf6, Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].CountOf7) AS
SumOfCountOf7, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf8) AS SumOfCountOf8, Sum([IMPORT AGENT ASSISTANT QUERY FOR
REPORT individual field totals].CountOf9) AS SumOfCountOf9, Sum([IMPORT AGENT
ASSISTANT QUERY FOR REPORT individual field totals].CountOf10) AS
SumOfCountOf10, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf11) AS SumOfCountOf11, Sum([IMPORT AGENT ASSISTANT QUERY FOR
REPORT individual field totals].CountOf12) AS SumOfCountOf12, Sum([IMPORT
AGENT ASSISTANT QUERY FOR REPORT individual field totals].CountOf13) AS
SumOfCountOf13, Sum([IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].CountOf14) AS SumOfCountOf14, Sum([TOTALS]) AS Expr1
FROM [IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field totals]
GROUP BY [IMPORT AGENT ASSISTANT QUERY FOR REPORT individual field
totals].[IMPORT AGT];


it works fine up to the point that I want to have the grand total for the
individual agents. I have tried:
Nz([count of no of paps no_Label],0) + Nz([count of no of other paps
no_Label,0 + Nz([count of 4]) + Nz([count of 5]) + Nz([count of 6]) +
Nz([count of 7]) + Nz([count of 8]) + Nz([count of 9]) + Nz([count of 10]) +
Nz([count of 11]) + Nz([count of 12]) + Nz([count of 13]) + Nz([count of 14]))

in the criteria field for the expr1 field. this did not work. When trying
to run the query I would be asked to input the date range and then the totals
amount. I do not want to input the totals amount I want the query to give it
to me. I have also tried =[count of no of paps no_Label] + [count of no of
other paps no_Label] and so on. this did not work either. If you have a
suggestion please let me know. I will continue to research.
 

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