17.10 - DATE and Date Arithmetic - 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 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.