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

Finds the difference between the ending and beginning bounds of a Period expression or a derived period and returns the difference as the duration of the argument in a specified interval qualifier.

Syntax

INTERVAL ( { period_expression | derived_period } ) interval_qualifier
period_expression
The Period expression to be converted.
derived_period
Any expression that evaluates to a Period data type.
interval_qualifier
Any interval qualifier appropriate for the argument's element type. The interval qualifiers are as follows:
  • Year-Month intervals:
    • YEAR
    • YEAR TO MONTH
    • MONTH
  • Day-Time intervals:
    • DAY
    • DAY TO HOUR, MINUTE or SECOND
    • HOUR
    • HOUR TO MINUTE or SECOND
    • MINUTE
    • MINUTE to SECOND
    • SECOND