Examples | NUMTODSINTERVAL Function | Teradata Vantage - 17.10 - Examples - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

Example: Converting numeric_value into an INTERVAL DAY(100) TO SECOND Value

The following query:

SELECT NUMTODSINTERVAL(100, 'DAY'); 

returns the result '100 00:00:00.000000', which is 100 days.

Example: Converting numeric_value into an INTERVAL DAY(100) TO HOURS Value

The following query:

SELECT NUMTODSINTERVAL(100, 'HOURS'); 

returns the result '4 04:00:00.000000', which is 4 days, 4 hours.

Example: Converting numeric_value into an INTERVAL DAY(100) TO MINUTES Value

The following query:

SELECT NUMTODSINTERVAL(1600, 'MINUTES'); 

returns the result '1 02:40:00.000000', which is 1 day, 2 hours, 40 minutes.

Example: Converting numeric_value into an INTERVAL DAY(100) TO HOURS Value

The following query:

SELECT NUMTODSINTERVAL(3.5, 'HOURS'); 

returns the result 3 hours, 30 minutes.