TRUNC_UDF (TIMESTAMP_LTZ, VARCHAR)
Definition
This user-defined function (UDF) reproduces the Teradata and Oracle TRUNC(Date) functionality when the format parameter is specified.
Parameters
DATE_TO_TRUNC
TIMESTAMP_LTZ
A timestamp_ltz
value to truncate which must be a date, timestamp, or timestamp with timezone.
DATE_FMT
VARCHAR
A varchar value that should be one of the date formats supported by the trunc
function.
Returns
Returns a date truncated using the format specified.
Usage example
Input:
Output:
Last updated