Gregorian Calendar Rules - Teradata Vantage - Analytics Database

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
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.