I have date in the format 1900-01-01 00:00:00.000 in the database. How can I write an IIF expression in SSRS iif date=1900-01-01 00:00:00.000 then display null or else display another field duration value. How can I get the colons working in iif expressions in ssrs? I am getting an error field when I run the report. Can someone help me in this?
0
votes
1 Answers
0
votes
You can write the expression like this:
=IIf(Fields!MyDate.Value <= "1/1/1900", Nothing, Fields!MyDate.Value)
Edit:
You can also use
=IIf(Fields!MyDate.Value <= "1/1/1900", 0, Fields!MyDate.Value)
And then you can set the formatting to:
=IIf(Fields!MyDate.Value <= "1/1/1900", "mm:ss tt", "d")
You can use whatever format string you want here. "d" is short for the standard "Short Date" format.