EXTRACT Function | SQL Date/Time Functions & Expressions | Teradata Vantage - 17.00 - 17.05 - EXTRACT - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)

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.