TD_DAY_OF_WEEK_COMPATIBLE_UDF

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Definition

Process the day of the week a timestamp belongs to. It has the same behavior as the DAYNUMBER_OF_WEEK(DATE, 'COMPATIBLE') function.

PUBLIC.TD_DAY_OF_WEEK_COMPATIBLE_UDF(INPUT TIMESTAMP_TZ)

Parameters

INPUT TIMESTAMP_TZ

The date to get the day of the week from.

Returns

Returns an integer between 1 and 7 where if January first is Wednesday then, 1 equals Wednesday, 2 equals Thursday... 7 equals Tuesday, and so on.

Usage example

Input:

SELECT PUBLIC.TD_DAY_OF_WEEK_COMPATIBLE_UDF(DATE '2022-01-01'),
PUBLIC.TD_DAY_OF_WEEK_COMPATIBLE_UDF(DATE '2023-05-05');

Output:

1, 6

Last updated