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)
 

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

Top