Data Type Compatibility | Date/Time Functions & Expressions | Teradata Vantage - Data Type Compatibility - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
xmd1556127764262.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantage™

The database convention of performing implicit conversions to resolve expressions of mixed data types is not supported for operations that include ANSI DateTime or Interval values.

To convert ANSI DateTime or Interval expressions, use the CAST function. See "CAST in Explicit Data Type Conversions" in Teradata Vantage™ - Data Types and Literals, B035-1143.

The following restrictions apply to the values appearing in all DateTime and Interval scalar operations:

IF … THEN …
two DateTime values appear in the same DateTime expression both values must use the same type.

You cannot mix DATE, TIME, and TIMESTAMP values across type.

a DateTime and Interval values appear in the same DateTime expression the Interval value must contain only DateTime fields that are also contained within the DateTime value.
two Interval values appear in the same Interval expression both values must use the same type.

You cannot mix Year-Month with Day-Time intervals.