DATE and Date Arithmetic - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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 in 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.