Reputation: 767
I understand IIF very well but I am trying to write an expression like the below in SSRS.
IF A<>B,"D"
=IIF(A <> B,"C","D") -- this doesn't work for me
What replaces the sign, "<>" in the expression?
Upvotes: 3
Views: 29607
Reputation: 86
Using IIF, your true part should come first. I would switch the position of your C and D, because currently, if A<>B then it will show C, not D. Try this:
=IIF(A <> B,"D","C")
Upvotes: 0
Reputation: 562
The <>
may not work if your values contain NULL
so you may have to run a multiple case comparison such as:
IiF(A<>B OR A IsNothing OR B IsNothing, "C", "D")
Upvotes: 4