16.20 - DATE Comparisons - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Data Types and Literals

Teradata Database
Teradata Vantage NewSQL Engine
March 2019
Programming Reference
If a field is to be inserted into a DATE column, the format must match either the ANSI DATE literal format or the format of the column. If a field is to be compared with a DATE value, the format must match one of the following:
  • ANSI DATE literal format
  • Format of the DATE value
  • DATE format determined by DateForm and default DATE data type format in the SDF. See DATE Formats.

For example, the comparison works if the data is CHAR(8) in the form YY/MM/DD and a DATE column format is YY/MM/DD. The comparison fails, however, if the column format is YYYY-MM-DD.

To perform comparisons that do not meet these qualifications, convert the values as described in Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates, B035-1145.