SQLTeam.com | Weblogs | Forums

Ssrs 2008 expression


#1

in an ssrs 2008 report, I have the following edit on a date field;

= IIF(Fields!r1RedWalletSentDate.Value= 0 or Fields!r1RedWalletSentDate.Value=" " or IsNothing(Fields!r1RedWalletSentDate.Value), " ", Fields!r1RedWalletSentDate.Value)

What I want to check for is if the value is 0, space, or is empty, display a space value. This works fine when there is a problem, but show #ERROR when the field contzins a real date.
Thus would you show me how to fix the expression, so that it will work correctly?


#2

What is the data type of the r1RedWalletSentDate field? The error appears to be due to type collisions. You might try converting it to string and displaying.

= IIF(Fields!r1RedWalletSentDate.Value= "0" or Fields!r1RedWalletSentDate.Value=" " or IsNothing(Fields!r1RedWalletSentDate.Value), " ", CStr(Fields!r1RedWalletSentDate.Value))