Error Conditions - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
Product Category
Teradata Vantage™

An error may be reported:

  • If the argument of the INTERVAL function does not have a Period data type.
  • If the argument has a PERIOD(DATE) data type and the interval qualifier is not YEAR, YEAR TO MONTH, MONTH, or DAY.
  • If the argument has a PERIOD(TIME(n) [WITH TIME ZONE]) data type and the interval qualifier is not HOUR, HOUR TO MINUTE, HOUR TO SECOND, MINUTE, MINUTE TO SECOND or SECOND.
  • If the result of an INTERVAL expression violates the rules specified for the precision of an interval qualifier, an error is reported. For example, assume p1 is a PERIOD(TIMESTAMP(0)) expression that has a value of PERIOD '(2006-01-01 12:12:12, 2007-01-01 12:12:12)'. If INTERVAL(p1) DAY is specified, the default precision for the DAY interval qualifier is 2, and, since the result is 365 days which is a three-digit value that cannot fit into a DAY(2) interval qualifier, an error is reported.
  • If the argument of the INTERVAL function is a period of a DATE or TIMESTAMP(n) [WITH TIME ZONE] and the ending bound value is UNTIL_CHANGED.