Returns the number of days from the beginning of the calendar starting on 01/01/1900 to the specified date.
the name of the database where the function is located.
an expression that results in a DATE, TIMESTAMP, or TIMESTAMP WITH TIME ZONE value.
This is a Teradata extension to the ANSI SQL:2011 standard.
td_day_of_calendar is an overloaded scalar function. It is defined with the following parameter 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.
For more information on overloaded functions, see “Function Name Overloading” in SQL External Routine Programming.
The result is an INTEGER value representing the number of days since and including 01/01/1900.
The td_day_of_calendar function provides improved performance compared to using the Sys_Calendar.Calendar system view to obtain similar results.
For more information about the CALENDAR system view, see Data Dictionary.
If the current date is January 05, 1901, the following queries return the value 370 as the result since January 05, 1901 is the 370th day since January 01, 1900.
SELECT td_day_of_calendar(DATE '1901-01-05');