Show Zero result in calculated field

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

Guest

I have created a calculated in a form. Sometimes the result of the
calculation is a minus amount. How can I show a minus amount as zero (0)?
 
Wayne Viles said:
I have created a calculated in a form. Sometimes the result of the
calculation is a minus amount. How can I show a minus amount as zero
(0)?

=IIf([CalcAmount] < 0, 0, [CalcAmount])

where CalcAmount is, of course your calculated amount. Example:

If your expression is now this:

=[Field1] + [Field2]

you'd use:

IIf([Field1] + [Field2] < 0, 0, [Field1] + [Field2])

Tom Lake
 
Many thanks. Works perfectly

Tom Lake said:
Wayne Viles said:
I have created a calculated in a form. Sometimes the result of the
calculation is a minus amount. How can I show a minus amount as zero
(0)?

=IIf([CalcAmount] < 0, 0, [CalcAmount])

where CalcAmount is, of course your calculated amount. Example:

If your expression is now this:

=[Field1] + [Field2]

you'd use:

IIf([Field1] + [Field2] < 0, 0, [Field1] + [Field2])

Tom Lake
 

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

Back
Top