Character Strings That Omit Hour, Minute, or Second - 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™

If the character string in a character-to-TIME conversion omits the hour, minute, or second, the system uses default values for the target TIME value.

IF the character string omits the … THEN the system uses the …
hour value of 0.
minute
second

Consider the following table:

CREATE TABLE time_log
   (id INTEGER 
   ,start_time TIME 
   ,end_time TIME
   ,log_time TIME);

The following INSERT statement converts three character strings to TIME values. The first character string omits the hour, the second character string omits the minute, and the third character string omits the second.

INSERT time_log
   (1001
   ,CAST ('01:02.030405' AS TIME FORMAT 'MI:SS.S(6)')
   ,CAST ('01:02.030405' AS TIME FORMAT 'HH:SS.S(6)')
   ,CAST ('01:02' AS TIME FORMAT 'HH:MI'));

The result of the INSERT statement is as follows:

SELECT * FROM time_log;
         id       start_time         end_time         log_time
-----------  ---------------  ---------------  ---------------
       1001  00:01:02.030405  01:00:02.030405  01:02:00.000000