ANSI Interval Expressions Rules - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530
The following rules apply to Interval expressions.
  • Expressions involving intervals are evaluated by converting the operands to integers, evaluating the resulting arithmetic expression, and then converting the result back to the appropriate interval.
  • The data type of both an interval_expression and an interval_primary is INTERVAL.
  • An interval_expression must contain either year-month interval components or day-time interval components. Mixing of INTERVAL types is not permitted.
  • Expressions involving intervals evaluate to an interval, even if the expressions contain DateTime or Numeric expressions.
What interval_expression Contains Result
Single component of type INTERVAL Has same INTERVAL type.
Single DateTime value or start  TO end phrase Contains DateTime fields specified for DateTime or start TO end phrase values.
Multiple components of type INTERVAL Has INTERVAL type including all DateTime fields of INTERVAL types of component fields.