Data Type Compatibility and Conversion | Teradata Vantage - Data Type Compatibility and Conversion - 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 assignments involving ANSI DateTime or Interval data types:

Source Type Target Type Description
DATE DATE The types are compatible and assignments do not require conversion.

For compatibility with existing Teradata assignments, non-ANSI operations such as assigning a DATE to an INTEGER or an INTEGER to a DATE (with validity checking) follow existing Teradata assignment rules.

TIME TIME The types are compatible and assignments do not require conversion.

The Teradata system value TIME is encoded as a REAL and is not compatible with ANSI TIME or TIME WITH TIME ZONE.

TIMESTAMP TIMESTAMP The types are compatible and assignments do not require conversion.
Year-Month INTERVAL Year-Month INTERVAL
Day-Time INTERVAL Day-Time INTERVAL
Numeric DATE Vantage performs implicit type conversion before the assignment.

For more information, see Teradata Vantageā„¢ - Data Types and Literals, B035-1143.

DATE
  • Character
  • Numeric
  • TIMESTAMP
Character
  • DATE
  • TIME
  • TIMESTAMP
TIME TIMESTAMP
TIMESTAMP
  • DATE
  • TIME
Interval
The INTERVAL type must have only one field. For example, INTERVAL YEAR.
Exact Numeric
Exact Numeric Interval

For all other source/target data type combinations in assignments involving ANSI DateTime or Interval data types, the types must be explicitly converted.

To perform explicit conversions on ANSI DateTime or Interval data types, use the CAST function.