RDLC报告中的日期时间数据字段出错

Any*_*are 1 c# asp.net datetime reporting-services ssrs-2008

我的Datetime字段报告遇到以下问题:

#Error
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我检查null或空但我总是得到这个错误

我试试这个:

=IIf(CDate(Fields!recommendationDate.Value)=CDate("1/1/0001"),Nothing,
 CDate(Fields!recommendationDate.Value).ToShortDateString())
Run Code Online (Sandbox Code Playgroud)
=IIf(FormatDateTime(Fields!recommendationDate.Value,2)=CDate("1/1/0001"),"",FormatDateTime(Fields!recommendationDate.Value.Value,2))
Run Code Online (Sandbox Code Playgroud)
=IIF(Fields!recommendationDate.Value is nothing, nothing,Format(CDate(Fields!recommendationDate.Value),"dd/MM/yyyy"))
Run Code Online (Sandbox Code Playgroud)

ees*_*ein 6

正确的代码是:

IIf(IsNothing(Fields!recommendationDate.Value), "",
              format(Fields!recommendationDate.Value, "dd/MM/yyyy"))
Run Code Online (Sandbox Code Playgroud)