17.10 - Result Types - 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)

EXTRACT returns an exact numeric value for ANSI SQL:2011 DateTime values.

EXTRACT returns values adjusted for the appropriate time zone if the data type of the argument is TIME or TIMESTAMP.

If no time zone is specified for the argument, then the time zone displacement based on the current session time zone is used; otherwise, the explicit time zone of the argument is used. You can use the AT clause to explicitly specify a time zone for the argument. For more information, see ANSI DateTime Expressions.

If you extract SECOND, then if the value has a seconds fraction precision of zero, the result is integer; if the value has a seconds factional prevision of greater than zero, the result is DECIMAL with the scaling as specified for the SECOND field in its data description.

If you extract anything else, the result is INTEGER with 32 bits of precision.

If you extract … THEN …
SECOND If value has a seconds fractional of precision of:
  • zero, the result is INTEGER.
  • greater than zero, the result is DECIMAL with the scaling as specified for the SECOND field in its data description.
anything else the result is INTEGER, with 32 bits of precision.

If value is NULL, the result is NULL.