# CAST() Function

### Description

Converts a value from one [data type](https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/datatypes) to another

### Syntax

```sql
CAST(expression AS datatype(length))
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _expression_ | Column or expression to evaluate | Any | Yes |
| _as\_type_ | Target data type for the conversion | Type name | Yes |

#### Notes

-   Requires CAST(x AS type). Two-arg CAST(x, 'type') is unsupported.

### Example

```sql
SELECT
    CAST(employee_number AS varchar)
FROM
    rippling.employee.Employee
LIMIT
    5;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/cast

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
