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

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.
 
S

Stuart McCall

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.
 
J

John W. Vinson

= [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!
 

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