TD_DAY_OF_WEEK_UDF

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

User-defined function (UDF) that reproduces the equivalent functionality of Teradata's TD_DAY_OF_WEEK. More information about the source function is here.

PUBLIC.TD_DAY_OF_WEEK_UDF(INPUT TIMESTAMP_TZ)

Parameters

INPUT TIMESTAMP_TZ

Date to get the day of the week from.

Returns

An integer between 1 and 7 where 1 is Sunday, 2 is Monday, 3 is Tuesday, ..., 7 is Saturday.

Migration example

Input:

IN -> Teradata_01.sql
SELECT td_day_of_week(DATE '2022-03-02');

Output:

OUT -> Teradata_01.sql
SELECT
PUBLIC.TD_DAY_OF_WEEK_UDF(DATE '2022-03-02');

Last updated