I am designing a tablix report and need to check the value of a field and do some calculations accordingly. I am using the IIF() function to do the comparisons. The comparisons are correct for values which do not contain the "<" or ">" characters, however values starting with "<" or ">" characters are not evaluated properly.
Please refer to the example below for reproducing the scenario.
=iif(Fields!Allowance.Value = "Between $50 and $100", "True", "False")
If the value of the string based Allowance field is equal to "Between $50 and $100", the output is "True" else "False".
However the same code is unable to evaluate the next condition where the value of the Allowance field is "> $100" or "< $50".
=iif(Fields!Allowance.Value = "> $100", "True", "False")
Even if the value of the Allowance field is "> $100", the output is always "False".
I have also tried expressions like
=iif(Fields!Allowance.Value = "> $100", "True", "False") and =iif(Fields!Allowance.Value = (CHR(62) + " $100"), "True", "False")
as i assumed the "<" and ">" signs might be treated as HTML when being evaluated by the expression, but still no luck.
There are no errors being thrown on runtime and the rendered value of Allowance field in the tablix is "> $100". Does anybody have any idea why this particular expression is not being evaluated correctly? Am i missing something here?
Thanks.
chr(62)but some other character that looks like it. Try outputing the value of the field and look at in a hex editor to see what characters actually make up the field. - Chris Latta=iif(LTrim(RTrim(Fields!Allowance.Value)) = "> $100", "True", "False")- Chris Latta