0
votes

I'm coming across strange behavior while evaluating expression in ssrs.

=IIF(Fields!LeadcreatedOn_createdonValue.Value is nothing OR Fields!createdonValue.Value is nothing,0,DateDiff("d",Format(Fields!LeadcreatedOn_createdonValue.Value,"MM/dd/yyyy"),Format(Fields!createdonValue.Value,"MM/dd/yyyy")))

When both fields has date value datediff works fine and difference is displayed but if one of the fields is empty instead of showing 0 it results in #error.

When I tried display "yes" or "no" depending on condition result , it worked fine. What is the problem in above expression?

Thanks

1

1 Answers

3
votes

i tried this expression and it's working fine. i think formatting is issue.

=IIF(Parameters!FDate.Value is nothing OR Parameters!TDate.Value is nothing,0,DateDiff("d",Parameters!FDate.Value,Parameters!TDate.Value))