TD_WEEK_OF_YEAR_UDF

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

Definition

User-defined function (UDF) that determines which "full week" of the year is based on a date. It is equivalent to the TD_WEEK_OF_YEAR and the WEEKNUMBER_OF_YEAR functions from Teradata.

PUBLIC.TD_WEEK_OF_YEAR_UDF(INPUT TIMESTAMP_TZ)

Parameters

INPUT TIMESTAMP_TZ

Date to get the number of week from.

Returns

A number that represents the week number the date belongs to.

Usage example

Input:

SELECT PUBLIC.WEEK_OF_YEAR_UDF(DATE '2024-05-10'),
PUBLIC.WEEK_OF_YEAR_UDF(DATE '2020-01-03')

Output:

18, 0

Last updated