Вопрос

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

This above query give me space if there is no date but it will give me #Error if there is a date value. Help.

Это было полезно?

Решение

You need to use isDate function to determine if its a date or not. Also SSRS iif condition are not short circuited.

=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 (Try to run ignoring short cicuit behaviour)

=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")), " ")
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top