If Statement

S

Scotty

I have a report that has the following fields

Baseline (from a table)
Total1 (from a table)
Total2 (from a table)
Total3 (calculated from the above 2 fields as field1-
field2)

I want to do an if, then, else

If (the Total3 calculated field) is less than the baseline
then display calculated field3 else display the baseline

I have tried everything I can think of and get either a
syntax or missing operator error message
 
M

Marshall Barton

Scotty said:
I have a report that has the following fields

Baseline (from a table)
Total1 (from a table)
Total2 (from a table)
Total3 (calculated from the above 2 fields as field1-
field2)

I want to do an if, then, else

If (the Total3 calculated field) is less than the baseline
then display calculated field3 else display the baseline

Try using this expression in Total3:

=IIf(Total1 - Total2 < Baseline, Baseline, Total1 - Total2)
 
Top