DATE Comparisons - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢
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.