Results - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
xmd1556127764262.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantage™

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.