adding up 1 to 25 fields Line totals to a sub totals

  • Thread starter Thread starter Kenj
  • Start date Start date
K

Kenj

= [LineTotal1]+[Line Total2] throught Line Total25 and Iam getting
sothing only if the entire 25 field have numbers. I think if the fields
are not full it brings back nothing.
 
Kenj said:
= [LineTotal1]+[Line Total2] throught Line Total25 and Iam getting
sothing only if the entire 25 field have numbers. I think if the fields
are not full it brings back nothing.

That sounds like you are getting Nulls in some of your totals. Try using the
Nz (Null to Zero) function, like this:

=Nz([LineTotal1]) + Nz([Line Total2]) + ...etc.
 
= [LineTotal1]+[Line Total2] throught Line Total25 and Iam getting
sothing only if the entire 25 field have numbers. I think if the fields
are not full it brings back nothing.

That's it. NULL means "this value is unknown, undefined, unspecified". If you
add 1 + 56 + 21 to Unknown, the sum is... unknown.

The NZ() function will return 0 if its argument is NULL:

NZ([linetotal1]) + NZ([linetotal2]) + NZ(...

will meet your needs.

One concern: if this is a Table with 25 LineTotal fields, your tables do not
appear to be correctly normalized!
 
Back
Top