SQLTeam.com | Weblogs | Forums

SSRS Expression giving wrong results

sql2008r2

#1

I have the SSRS expression as below which gives wrong values for the different codes as input parameter.
The same results for different values given as input.

=First(Fields!MaterialItemName.Value, "DsChemAudit") & VbCrLf & " " &
First(Fields!AlternateName.Value, "DsChemAudit")

I think the problem is because of using the First(). Please help me to correct this. Any other alternate way to rewrite the expression


#2

Can you post a sample of your input data, what your expression produces and what you want to yield.


#3

I changed the expression as below and the values got corrected. Thanks.

= Fields!MaterialItemName.Value & VbCrLf & " " &
IIF(IsNothing(Fields!AlternateName.Value) OR Fields!AlternateName.Value = "", Nothing,Fields!AlternateName.Value & VbCrLf )