td_week_end
Purpose
Returns the week end that falls immediately after the DATE or TIMESTAMP specified in expression_1.
Syntax
Syntax Elements
calendar_name
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.
expression_1
An expression that results in a DATE, TIMESTAMP, or TIMESTAMP WITH TIME ZONE value.
If expression_1 is DATE, expression_2 cannot be specified.
expression_2
A TIME, TIME WITH TIME ZONE, or NULL value. If NULL is specified, TIME is assumed to be 23:59:59+00:00.
NULL
The business calendar for the session.
TD_SYSFNLIB
Name of the database where the function is located.
ANSI Compliance
This is a Teradata extension to the ANSI SQL:2011 standard.
Argument Types
The function is overloaded and can be invoked with one, two, or three arguments.
The first argument can be one of the following data types:
The second argument can be one of the following system-defined calendars (TERADATA, ISO, or COMPATIBLE) or NULL
The third argument can be one of the following data types:
Result
The function is overloaded and can be invoked with one, two, or three arguments.
The first argument can be one of the following data types:
The second argument can be one of the following system-defined calendars (TERADATA, ISO, or COMPATIBLE) or NULL
The third argument can be one of the following data types:
Example
The following SQL statement:
SELECT TD_WEEK_END(timestamp'2012-05-08 10:00:00');
returns 2012-05-12 23:59:59
.
where no calendar specified indicates the session calendar, which in this example
is TERADATA
.