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

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

Aggregate Function Error 0
IIF statement on a report 1
Trying to Count in a Report 3
Help with Iif Statement 5
IIF statement 5
Is that your Final Answer????? 13
iif statement 2
Sum an IIF 4

Back
Top