jhowe
jhowe

Reputation: 10878

SSRS IIF Multiple expression not working

Please see pic enter image description here

For some reason my expression is not working and I cannot figure out why...

What I'm trying to do is check the UseByDate if it's blank set time to blank AND if pickeddatetime is blank (time field) also set to blank if not blank use pickeddatetime. However my expression doesn't seem to be working correctly for some reason?

=IIF(Fields!UseByDate.Value is nothing, nothing, IIF(Fields!PickedDateTime is nothing, nothing, FORMAT(System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!PickedDateTime.Value), "HH:mm")))

I've checked the pickeddatetime value and it is definitely null for this row.

enter image description here

Upvotes: 0

Views: 619

Answers (2)

Oro
Oro

Reputation: 1867

Replace Fields!PickedDateTime with Fields!PickedDateTime.Value

Upvotes: 1

Jeffrey Van Laethem
Jeffrey Van Laethem

Reputation: 2651

I think the way the expression is written isn't checking for nothing correctly. Try:

=IIF(IsNothing(Fields!UseByDate.Value)=True, nothing, IIF(IsNothing(Fields!PickedDateTime)=True, nothing, FORMAT(System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!PickedDateTime.Value), "HH:mm")))

Upvotes: 1

Related Questions