using sum and Iif statement

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, ?????)
 
G

Guest

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

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

Guest

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])
 
G

Guest

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, ?????)
 
G

Guest

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, ?????)
 
G

Guest

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, ?????)
 
A

artek

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, ?????)
 

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

Similar Threads


Top