Tuesday, June 26, 2012

In an RDLC formatting the date to shortDate sometimes fails and s#Error, even when the data looks perfectly good.

Change this:

=Format(Fields!SurveyCompDt.Value,"dd.MM.yyyy HH:mm:ss")

To This:

=IIf(CDate(Fields!SurveyCompDt.Value)=CDate("1/1/0001"),Nothing,CDate(Fields!SurveyCompDt.Value).ToShortDateString())
and it should go away.

The bug appears to have to do with the conversion of the dates.


No comments:

Post a Comment