Find Invalid Cold Fusion Expression error

I m using report builder and when i m have a fomulae of calculated field is:
iif(calc.totalrevenue eq 0,0,100*(calc.totaldollars/calc.totalrevenue)) i got an invalid coldfusion expression error i know that is becoz of ‘/’ division sign b’coz when i remove it and calc.totalrevenue it works fine.


plz tell me where i m wrong

The syntax in the way you’re using iif() is wrong. Iif has to have the following:

Iif( condition, true, false )

So in the above example you need to include the outputs for of that condition is true and if that condition is false.



that i mentioned in iff condition that id totalRevenue eq 0 then the output is 0, else totaldollars will divide by it and multiply by 100

Could it be a “division by 0” error?