Show Zero result in calculated field

W

Wayne Viles

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

Tom Lake

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
 
W

Wayne Viles

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
 
Top