if ({Dao.SpWDiscount}='100') then {Dao.CurrentSpecialWater}=0 else {Dao.CurrentSpecialWater}

it shows boolean is required  here
anjali kulkarniAsked:
Who is Participating?
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Change to:
if  ({Dao.SpWDiscount}='100') then 0  else  {Dao.CurrentSpecialWater}
Ido has given you the solution, however a bit of an explanation will help you avoid the issue in the future.

A IF statement can return one of 2 results.  One for the THEN part (if test is TRUE) and one for the ELSE part (if test is FALSE).
These 2 results must be the same data type.  

In your example the THEN part returns a BOOLEAN value of the comparison between Dao.CurrentSpecialWater and 0.  The Else part returns the value of Dao.CurrentSpecialWater which is a number.

Ido's solution is to return 0 for the THEN part and Dao.CurrentSpecialWater for the ELSE part.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.