0

I'm working on an ssrs report using Report builder 2008, currently trying to concatenate using something like this but when I do so, I receive an error for the field 'lifeamount' specifying that the expression can only refer to fields within the current dataset scope. I've tried different ways to specify the dataset which is the same for all the fields but to no avail. Is this even possible?

=rtrim(First(Fields!FRSTNAME.Value,"EmployeeInfo")) & " " & rtrim(First(Fields!MIDLNAME.Value, "EmployeeInfo")) & " " & rtrim(First(Fields!LASTNAME.Value, "EmployeeInfo")) & " " & IIF((Fields!Lifeamount.Value)> 100000.00, 100000.00, Fields!lifeamount.value, "EmployeeInfo"))

KAL077
  • 85
  • 1
  • 1
  • 7
  • Where is this expression in your report? Is it in an unbound textbox or a matrix/table or chart? – iamdave Nov 16 '17 at 15:15

2 Answers2

1

SSRS expressions are case sensitive which means that your second lifeamount reference is more than likely wrong.

Try this instead:

=rtrim(First(Fields!FRSTNAME.Value,"EmployeeInfo")) & " " &
rtrim(First(Fields!MIDLNAME.Value, "EmployeeInfo")) & " " &
rtrim(First(Fields!LASTNAME.Value, "EmployeeInfo")) & " " &
IIF((Fields!Lifeamount.Value)> 100000.00, 100000.00, Fields!Lifeamount.value, "EmployeeInfo"))
iamdave
  • 12,023
  • 3
  • 24
  • 53
1

If the expression is located in a cell that is within the same scope as the details you are fetching (i.e. "EmployeeInfo") then I don't think you need to specify it at all.

Also there are some brackets out of place I think. I can't test it at the moment but try this...

=rtrim(First(Fields!FRSTNAME.Value,"EmployeeInfo")) & " " & 
rtrim(First(Fields!MIDLNAME.Value, "EmployeeInfo")) & " " &
rtrim(First(Fields!LASTNAME.Value, "EmployeeInfo")) & " " &
IIF((Fields!Lifeamount.Value, "EmployeeInfo")> 100000.00, 100000.00, (Fields!Lifeamount.value, "EmployeeInfo"))
Alan Schofield
  • 19,839
  • 3
  • 22
  • 35