- Categories:
AS_ TIMESTAMP_ *¶
Casts a VARIANT value to the respective timestamp value:
- AS_TIMESTAMP_LTZ (value with local time zone)
- AS_TIMESTAMP_NTZ (value with no time zone)
- AS_TIMESTAMP_TZ (value with time zone)
- See also:
Syntax¶
Arguments¶
variant_exprAn expression that evaluates to a value of type VARIANT.
Returns¶
The function returns a value of a timestamp type or NULL:
- If the type of the value in the
variant_exprargument is a timestamp type, the function returns a value of same timestamp type.
- If the type of the value in the
variant_exprargument doesn’t match the type of the output value, the function returns NULL. - If the
variant_exprargument is NULL, the function returns NULL.
Examples¶
Create a table and load data into it:
Use the AS_TIMESTAMP_NTZ function in a query to cast a VARIANT value to a TIMESTAMP_NTZ value: