Gregorian Calendar Rules - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
xmd1556127764262.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantage™

DateTime expressions always operate within the rules of the Gregorian calendar.

When an evaluation results in a value outside the permissible range for any contained field or results in a value impermissible according to the natural rules for DATE and TIME values, then an error is returned.

For example, the following operation returns an error because it evaluates to a date that is not valid (‘1996-09-31’).

SELECT DATE '1996-08-31' + INTERVAL '1' MONTH;

The desired result is obtained with a slight rephrasing of the second operand.

SELECT DATE '1996-08-31' + INTERVAL '30' DAY;

This operation returns the desired result, ‘1996-09-30’. No error is returned.