Data Type Compatibility and Conversion | Teradata Vantage - 17.10 - Data Type Compatibility and Conversion - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1211-171K
Language
English (United States)

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.