Examples - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

Example: Converting string_value specified as an SQL Interval Format

The following query, which specifies an SQL interval format:

SELECT TO_DSINTERVAL('100 04:23:59'); 

returns the result '100 04:23:59.000000'.

Example: Converting Another string_value specified as an SQL Interval Format

The following query, which specifies an SQL interval format:

SELECT TO_DSINTERVAL('100 04:23:59.543'); 

returns the result '100 04:23:59.543000'.

Example: Converting string_value specified as an ISO Duration

The following query, which specifies an ISO duration:

SELECT TO_DSINTERVAL('P100DT4H23M59S'); 

returns the result '100 04:23:59.000000'.

Example: Converting string_value specified as an ISO Duration of 73 hours

The following query, which specifies an ISO duration of 73 hours:

SELECT TO_DSINTERVAL('PT73H'); 

returns the result '3 01:00:00.000000', which is 3 days, 1 hours.

Example: Converting string_value Error

The following query:

SELECT TO_DSINTERVAL('P2MT12H'); 

returns an error because the month designator, '2M', isn't allowed.