17.10 - DATE and Date Arithmetic - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

The DATE - DATE expression is not processed as a simple subtraction, but rather as explained in the following process:

  1. The encoded date values are converted to intermediate values which are each the number of days since a system-defined fixed date.
  2. The second of these values is then subtracted from the first, giving the number of days between the two dates.
  3. The result is returned as if it were in the ANSI SQL:2011 form INTERVAL DAY, though the value itself is an integer.

Other arithmetic operations on date values may provide results, but those results are not meaningful.