Page 1 of 1

IIF Funtion with bool & integer varaibles

Posted: Thu Jan 06, 2022 1:01 pm
by Bisoux
Hi,

I have the following integer variables, BasicSalaryFrom & BasicSalaryTo. I have a bool variable called AllBasicSalary. If the user selects AllBasicSalary I want the filter to retrieve all salary records and ignore any value entered in the two integer variables.

What will be the correct way of implementing this ? I tried the following,

Code: Select all

Bonus.Basic_Salary >= BasicSalaryFrom || AllBasicSalary
Bonus.Basic_Salary <= BasicSalaryTo || AllBasicSalary
Adding this filter does seems to be filtering records with 0 value.

Thank you

Re: IIF Funtion with bool & integer varaibles

Posted: Fri Jan 07, 2022 9:48 am
by Lech Kulikowski
Hello,

You can use the following expression:
(Bonus.Basic_Salary >= BasicSalaryFrom && Bonus.Basic_Salary <= BasicSalaryTo) || AllBasicSalary

Thank you.