using sum and Iif statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using unbound text box to sum some information, and if there is nothing
to add I would like the text box to have 0 else the sum of the books. The
following is what I have but am not sure what to put in the ?????
=iif(sum([books])=0, 0, ?????)
 
Try use the NZ, It will display the sum of books, and if there are none it
should display 0

=Sum(NZ([books], 0))
 
It would read =iif(sum([books])=0, 0, sum([books]))

But why this way?

If you want to display zero if the sum is zero and sum if it is not zero why
not just sum([books])
 
sum(nz([books])) will work

sam

KARL DEWEY said:
It would read =iif(sum([books])=0, 0, sum([books]))

But why this way?

If you want to display zero if the sum is zero and sum if it is not zero why
not just sum([books])

JOM said:
I am using unbound text box to sum some information, and if there is nothing
to add I would like the text box to have 0 else the sum of the books. The
following is what I have but am not sure what to put in the ?????
=iif(sum([books])=0, 0, ?????)
 
Thanks that helped!

Ofer said:
Try use the NZ, It will display the sum of books, and if there are none it
should display 0

=Sum(NZ([books], 0))

--
In God We Trust - Everything Else We Test


JOM said:
I am using unbound text box to sum some information, and if there is nothing
to add I would like the text box to have 0 else the sum of the books. The
following is what I have but am not sure what to put in the ?????
=iif(sum([books])=0, 0, ?????)
 
Thanks that helped!

SAm said:
sum(nz([books])) will work

sam

KARL DEWEY said:
It would read =iif(sum([books])=0, 0, sum([books]))

But why this way?

If you want to display zero if the sum is zero and sum if it is not zero why
not just sum([books])

JOM said:
I am using unbound text box to sum some information, and if there is nothing
to add I would like the text box to have 0 else the sum of the books. The
following is what I have but am not sure what to put in the ?????
=iif(sum([books])=0, 0, ?????)
 
KARL DEWEY said:
It would read =iif(sum([books])=0, 0, sum([books]))

But why this way?

If you want to display zero if the sum is zero and sum if it is not zero why
not just sum([books])

JOM said:
I am using unbound text box to sum some information, and if there is nothing
to add I would like the text box to have 0 else the sum of the books. The
following is what I have but am not sure what to put in the ?????
=iif(sum([books])=0, 0, ?????)
 
Back
Top