17.00 - 17.05 - Gregorian Calendar Rules - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)

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.