Sum Function Error

S

S Himmelrich

I'm experienced with using the SUM function in MS Access. After
confirming my syntax of:

FY11 CAPEX Forecast: =sum([2011 Q1 CAPEX Forecast Cost]+ [2011 Q2
CAPEX Forecast Cost] + [2011 Q3 CAPEX Forecast Cost] + [2011 Q4 CAPEX
Forecast Cost])

I get an error that says: "You tried to execute a query that does not
include the specified expression 'Total Capital' as part of an
aggregate function."

This is a little misleading to me as I do include the referenced field
in the select statement, however is not part of the SUM Function
statement above - help please?

Scott
 
J

John W. Vinson

I'm experienced with using the SUM function in MS Access. After
confirming my syntax of:

FY11 CAPEX Forecast: =sum([2011 Q1 CAPEX Forecast Cost]+ [2011 Q2
CAPEX Forecast Cost] + [2011 Q3 CAPEX Forecast Cost] + [2011 Q4 CAPEX
Forecast Cost])

I get an error that says: "You tried to execute a query that does not
include the specified expression 'Total Capital' as part of an
aggregate function."

This is a little misleading to me as I do include the referenced field
in the select statement, however is not part of the SUM Function
statement above - help please?

Scott

The Sum() SQL operator sums a field over multiple rows in a Totals query. I
don't think the error message has anything to do with this expression - could
you post the complete SQL?

Note that if you just want to add these four costs to calculate a total cost,
you don't need or want the Sum() operator. You do need the Sum if you're using
a totals query and trying to calculate a "grand total" of multiple records,
summing these individual costs for each record and then summing those sums.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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