SSRS CDec Function

The SSRS CDec function is a Conversion function that will convert the given field or expression to a decimal. The syntax of the CDec function for converting to decimal values is as shown below.

CDec(Fields!Income.Value)
CDec(90.567)

To demonstrate the CDec 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 CDec function Example

In an SQL database, the Order Quantity column is a Small int Data type, and both the Sales Amount and Yearly Income are Money data types.

For this, let me add a new column to the right side of the Orders column. Next, right-click the textbox under the CDec Ord and choose Expression to open the expression window below. The CDec expression below will convert the OrderQuantity column values to decimals.

  1. More Functions
  2. Charts
  3. Tables
  4. Format tables
  5. SSRS
=CDec(Fields!OrderQuantity.Value)
SSRS CDec Function expression to convert numeric values to double

Similarly, let me create two more new columns to convert the SalesAmount and YearlyIncome values to decimals. The SSRS CDec function expressions for this are shown below.

=CDec(Fields!SalesAmount.Value)
=CDec(Fields!YearlyIncome.Value)

Please click the preview tab to see the CDec report.

SSRS CDec Function to convert numeric values to double report