Returns the number of weeks from the beginning of the quarter to the specified date.
A calendar name. The possible values are Teradata, ISO, and COMPATIBLE.
This argument must be a character literal and cannot be a table column or expression. If you do not name a calendar, Teradata uses the calendar for the session.
An expression that results in a DATE, TIMESTAMP, or TIMESTAMP WITH TIME ZONE value.
The business calendar for the session.
Name of the database where the function is located.
This is a Teradata extension to the ANSI SQL:2011 standard.
The first argument, expression, is defined with the following data types:
The second argument, calendar_name, is optional and is defined with the following argument data types:
If the argument passed to the function does not match one of these declared data types, an error is returned indicating that the function does not exist.
The result is an INTEGER value between 1 and 14, representing the nth week of the quarter. The value 0 means the partial week, Week0.
If the current date is April 20, 2011, the following query returns
3 because April 20, 2011, is in the third week of the quarter in the Teradata calendar:
The following query returns
3 because April 20, 2011, is in the third week of the quarter in the ISO calendar:
SELECT TD_SYSFNLIB.WEEKNUMBER_OF_QUARTER (DATE '2011-04-20', ’ISO’);