Gregorian Calendar Rules - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
dzx1591742169550.ditamap
dita:ditavalPath
dzx1591742169550.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.