Im creating a generic list report. For each column X i check if its DataType = 5, then i format to shortdate all those values.
This works when datatype is 5 and dates come out fine. When tits not 5 , thus just string value like Name, I get #Error.
It looks like it evaluates both IIF outcomes and during that it "crashes". What Can I do? Or what am I doing wrong?
=IIf(First(Fields!ColumnDataTypeX.Value, "ColumnQuery") = 5, FormatDateTime(Fields!ColumnX.Value, DateFormat.ShortDate), Fields!ColumnX.Value)
Thanks in advance