Problem with SUM Function

A

Amanda

Hi,
In my report I am using a SUM function but instead of adding the values it
just lists them.

Example :
Value a-1
Value b- 2
Value c-6
SUM should be : 9
But Access is displaying: 126

Any suggestions?

Thanks.
 
A

Allen Browne

Since Access believes these values are Text (not numbers), it is
concatenating them instead of summing them.

The solution will therefore be to typecast the value to one of the numeric
types, e.g. CLng() for whole numbers.

More info:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
 
O

Ofer Cohen

What did yo use to add up the values?

If the field type is text and you used:
=[a] + + [c]
Then it will list the values, it add a string to a string.
If that the case, change it to
=Val(Nz([a],0)) + Val(Nz(,0)) + Val(Nz([c],0))

Changing it to number, and using the Nz to replace Null to 0
 
Top