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™
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 always evaluate to an interval, even if the expressions contain DateTime or Numeric expressions.
IF an interval_expression contains … THEN the result …
only one component of type INTERVAL is of the same INTERVAL type.
a single DateTime value or a start  TO end phrase contains the DateTime fields specified for the DateTime or start TO end phrase values.
more than one component of type INTERVAL is of an INTERVAL type including all the DateTime fields of the INTERVAL types of the component fields.