report developer 3.0日期函数

时间:2014-05-02 20:35:09

标签: reporting-services

=IIF (Fields!LastGiftDate.Value >0, (Format(Cdate (Fields!LastGiftDate.Value),"dd-MM-yyyy")), " ")

如果没有日期,上面的查询会给我空间,但如果有日期值,它会给我#Error。帮助

1 个答案:

答案 0 :(得分:0)

您需要使用isDate函数来确定它是否为日期。 SSRS iif条件未被短路

=IIF (isDate(Fields!LastGiftDate.Value) 
     ,IIF (isDate(Fields!LastGiftDate.Value), (Format(Cdate (Fields!LastGiftDate.Value),"dd-MM-yyyy")),NOTHING)
     , " ")

OR

=IIF (isDate(Cdate(Fields!LastGiftDate.Value)) 
     ,IIF (isDate(Fields!LastGiftDate.Value), (Format(Cdate (Fields!LastGiftDate.Value),"dd-MM-yyyy")),NOTHING)
     , " ")

OR(尝试忽略短cicuit行为)

=IIF (isDate(Fields!LastGiftDate.Value), (Format(Cdate (Fields!LastGiftDate.Value),"dd-MM-yyyy")), " ")

OR

=IIF (isDate(Cdate(Fields!LastGiftDate.Value)), (Format(Cdate (Fields!LastGiftDate.Value),"dd-MM-yyyy")), " ")