• To extract the year value, my suggestion is to use a SUBSTRING function instead of nested LEFT and RIGHT functions. This is possible if the four digits of the year are always in the same four positions in the string (as they are for the two examples given). Example:

    To extract the month value, my suggestion is again to use a SUBSTRING function, since the starting position appears to be fixed for all rows of data and since you can omit the length parameter and get all the characters from the starting position to the end of the string. To remove the square brackets I would suggest the REPLACE function or method to "replace" the "]" with "" (nothing between double-quotation marks). That would leave just the number of the month.

    Here is a sample of code to do what you are seeking to do:

    =CDate(CStr(Parameters!ToMonth.Value).Substring(20,4) & "/" & CStr(Parameters!ToMonth.Value).Substring(29).Replace("]", "") & "/1").AddMonths(-11)

    *Edit Note: I almost forgot that parameter and field values are not "typed" natively in SSRS, so it is necessary to use a convert function to make their types explicit in the context of the expression. So I added CStr() functions around the parameter value references.