SSRS Val Function

The SSRS Val function is an interesting Conversion function that extracts and returns the number from a given string expression or the text field as a numeric value of appropriate datatype. The syntax of the Val function to extract numeric values or numbers from the string column is shown below.

=Val(Fields!Address.Value)

To demonstrate the Val function in reporting services, we use the Employee table below, which has 20 records. The image shows the records in the Table report.

Source Table

SSRS Val function Example

For this, let me add a new column to the right side of the AddressLine1 column. Next, right-click the textbox under Val and choose the Expression.

  1. More Functions
  2. Charts
  3. Tables
  4. Format tables
  5. SSRS
Choose the expression option

It will open the below-shown expression window. The SSRS Val function expression below will extract and return the number or numeric value from the address field.

=Val(Fields!AddressLine1.Value)
SSRS Val Function expression to extract integer or number from string column

Please click the preview tab to see the Val report.

SSRS Val Function to extract integer or number from string column report