Sum help

L

lmossolle

I am using the following expression, it is not totaling correct it shows up
as 370 and the correct value is 54,759,393

Here is the expression...

Sum(IIf([PR $ Value],1,0)) AS [$ Value]
 
A

akphidelt

I tried to post on IE but I think it didn't go through, so here is another
attempt on FireFox

But the Expression IIf([PR $ Value],1,0) Returns the value 1 or 0. So
technically you are counting the number of times that expression is true.

Try

Sum(Nz([PR $ Value])) As [$ Value]
 
J

John Spencer

What that expression does is Count the number of times Pr $ Value has a some
value other than zero.

If you want to sum PR $ Value the expression should be
SUM([PR $ Value])

IF you want to do something else. Please tell us in words what you are
trying to accomplish.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
L

lmossolle

How can this be displayed as a $value?

Thanks!!!!!

John Spencer said:
What that expression does is Count the number of times Pr $ Value has a some
value other than zero.

If you want to sum PR $ Value the expression should be
SUM([PR $ Value])

IF you want to do something else. Please tell us in words what you are
trying to accomplish.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

lmossolle said:
I am using the following expression, it is not totaling correct it shows up
as 370 and the correct value is 54,759,393

Here is the expression...

Sum(IIf([PR $ Value],1,0)) AS [$ Value]
 
J

John Spencer

Set the format property of the control to currency

Or if you don't need to do anything else with the sum, you can use the
Format function and force a currency format.

=Format(Sum([PR $ Value]),"Currency")

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

How can this be displayed as a $value?

Thanks!!!!!

John Spencer said:
What that expression does is Count the number of times Pr $ Value has a some
value other than zero.

If you want to sum PR $ Value the expression should be
SUM([PR $ Value])

IF you want to do something else. Please tell us in words what you are
trying to accomplish.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

lmossolle said:
I am using the following expression, it is not totaling correct it shows up
as 370 and the correct value is 54,759,393

Here is the expression...

Sum(IIf([PR $ Value],1,0)) AS [$ Value]
 

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