SSRS Left Function

The SSRS Left function is a Text function that returns the specified number of left-side characters from the given field. This article explains how to use the Left function to build a string from a few leftmost characters with an example.

The syntax of the SSRS Left function to create a new string containing the specified number of leftmost characters is as shown below.

=Left(Fields!FullName.Value, 5)

To demonstrate the SSRS Left function, we use the Employee table below, which has 15 records grouped by Occupation. The image shows the records in the Table report.

Source Table

SSRS Left function Example

For this, let me add a new column to the right side of the Name column. Next, right-click the textbox under the LName and choose the Expression. To understand the report, I suggest you refer to the articles on charts, tables, grouping, and format tables in SSRS.

Choose the expression option

It opens the following expression window to return the leftmost characters. The below SSRS Left function returns the first four characters from the Name column and builds a new string.

=Left(Fields!Name.Value, 4)
SSRS Left Function expression

Please click the preview tab to see the leftmost four characters from the Name field. For more functions >> Click Here!

SSRS Left Function to extract leftmost Characters preview

Although the above report shows the correct result, the text lacks meaning. So, let me use this Left function to extract the First Name from the Name field. To do so, edit the expression and write the one shown below. The InStr function finds the index position of the space, and we subtract one from it to avoid extra space after the First Name. Next, the SSRS Left function returns the characters from the left-side up to the empty space.

=Left(Fields!Name.Value, InStr(Fields!Name.Value, " ") - 1)
Expression to extract first name

Similarly, let me create one more column to the right of the Email column. Next, right-click the textbox under it to write the expression below. Here, the left function returns the leftmost characters from the Email column up to the @ symbol.

=Left(Fields!Email_Adress.Value, InStr(Fields!Email_Adress.Value, "@") - 1)

Please check the report preview.

SSRS Left Function to extract first name report preview