EXTRACT Function | SQL Date/Time Functions & Expressions | Teradata Vantage - EXTRACT - 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ā„¢

Extracts a single specified full ANSI SQL:2011 field from any DateTime or Interval value, converting it to an exact numeric value.

Syntax

EXTRACT (
  { YEAR | MONTH | DAY | HOUR | MINUTE |
    SECOND | TIMEZONE_HOUR | TIMEZONE_MINUTE
  } FROM value
)
YEAR
The integer value for YEAR to be extracted from the date represented by value.
MONTH
The integer value for MONTH to be extracted from the date represented by value.
DAY
The integer value for DAY to be extracted from the date represented by value.
HOUR
The integer value for HOUR to be extracted from the date represented by value.
MINUTE
The integer value for MINUTE to be extracted from the date represented by value.
TIMEZONE_HOUR
The integer value for TIMEZONE_HOUR to be extracted from the date represented by value.
TIMEZONE_MINUTE
The integer value for TIMEZONE_MINUTE to be extracted from the date represented by value.
SECOND
The integer and decimal values for SECOND are to be extracted from the date represented by value. The returned value has a data type of DECIMAL(8,2).
value
An expression that results in a DateTime, Interval, or UDT value.