Reputation: 101
I have the following code
=IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value)
In this code I check to see if Fields!effectivedate.Value
is the current month.
Fields!effectivedate.Value
.In addition to doing this check I would like to check for another value, fields!Freeze.Value
Here is how it would look in VB.NET code
If fields!Freeze.Value = true
Fields!effectdate.Value
else
IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value)
end if
How would I write this in SSRS code?
Please ask for further clarification if i have failed to explain something properly.
Upvotes: 0
Views: 961
Reputation: 4972
You will need to use a nested IIf
function as started by @lc. however you need to be more clear what you want to check for in the Freeze
field.
For example you can check for blanks using the IsNothing()
function, or if its a booleon you may need to see if Fields!Freeze.Value = 1
.
Upvotes: 0
Reputation: 116438
Just nest the IIfs:
=IIf(Fields!Freeze.Value, Fields!effectdate.Value, IIF(Month(Fields!effectivedate.Value) <> Month(Now()), Now(), Fields!effectdate.Value))
Upvotes: 1