CAST

CAST#

Converts a value from one data type to another. CAST is the ISO-standard conversion function and is the preferred form where a style is not needed.

Syntax#

CAST ( expression AS data_type [ ( length ) ] )

Examples#

SELECT CAST('2017-05-04' AS date);
SELECT CAST(123.45 AS int);

See Also#