IIF Funtion with bool & integer varaibles

Stimulsoft Reports.NET discussion
Post Reply
Bisoux
Posts: 16
Joined: Wed Jul 08, 2020 12:30 pm

IIF Funtion with bool & integer varaibles

Post 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
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: IIF Funtion with bool & integer varaibles

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply