INTERVAL Function | SQL Date/Time Functions & Expressions | Teradata Vantage - 17.00 - 17.05 - INTERVAL - 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)

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