For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

TRY_CAST() Function

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

Attempts to cast a value to a specified data type, returns NULL if unsuccessful

Syntax​

TRY_CAST(expression AS target_data_type)

Parameters​

ParameterDescriptionData TypeRequired
expressionColumn or expression to evaluateAnyYes
as_typeTarget data type for the conversionType nameYes

Example​

SELECT
TRY_CAST(employee_number AS varchar)
FROM
rippling.employee.Employee
LIMIT
5;