Dear all,
I am having error when running the sum e.g. =Sum([A]) , the value of [A]
will be 0 or null. I tried: sum(Nz([A],0)) and Nz(sum([A]),0) , but both
still got error on it. can anyone give me a hand?
Thanks
Yolip
Marshall Barton - 12 Dec 2005 01:40 GMT
> I am having error when running the sum e.g. =Sum([A]) , the value of [A]
>will be 0 or null. I tried: sum(Nz([A],0)) and Nz(sum([A]),0) , but both
>still got error on it. can anyone give me a hand?
You've leapt to the wrong conclusion ;-)
Sum is not bothered by either Null or 0. All of the
Aggregate functions ignore Null values and adding a 0 to
anything doesn't affect the result.
Most likely the problem is that your [A] is not a **field**
in the form's record source table/query. It's a common
mistake to use a **control** name instead of a field name.
If that's not the issue. post a Copy/Paste of the actual
expression that you're using along with an explanation of
where the terms are coming from.

Signature
Marsh
MVP [MS Access]
Duane Hookom - 12 Dec 2005 01:55 GMT
If the value of [A] will be 0 or null, the sum will always be 0.
What does your error look like? Is the name of the control something other
than a field name?

Signature
Duane Hookom
MS Access MVP
--
> Dear all,
>
[quoted text clipped - 5 lines]
> Thanks
> Yolip