Result Types - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
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.