ssrs 2008 using a substring

  • In an ssrs 2008 report, I would like to select on only part of a value that displays on the report heading. I have tried to use the mid function so far, but I have not been able to select the correct part of the string I want to see.

    An example of a value is 'Grace Elementary - 066 15-16 Grace Elem' and I want the value to look like

    '066 15-16 Grace Elem' . Thus would you show me how to change the display value to be '066 15-16 Grace Elem'?

  • Have you tried Right(Expression, 20)?


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • You need INSTR

    =Right(Variables!TheSchool.Value,Instr(Variables!TheSchool.Value," - ")+3)

  • The school value could also look like ' King Potter (7-8) - 894 15-16 King Potter Tech'. The value I want from this string is '894 15-16 King Potter Tech'.

    The best way to obtain the needed value is to start from the right side and look for '-' before the 894. Thus could you show me how to access that data?

    How would you obtain the this value and the previous one that I listed above?

  • This worked for me:

    =RIGHT(Fields!School.Value,LEN(Fields!School.Value)-InStr(Fields!School.Value," - ")-2)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply