Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 21 Apr 2004 @ 12:22:01 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Seconds to time column conversion
 
From:   Dieter Noeth

  How to update a column which is in varchar(20) that contains values in seconds for eg. 9999 to HH:MI:SS format like 2:46:39.  



create table xxx(x varchar(20));
ins xxx('9999');
ins xxx('99999999');
ins xxx('123456');
ins xxx('12');

sel
  (((x (int)) / 3600) (format 'ZZZZ99'))
  || (((x (int)) mod 3600) / 60 (format ':99'))
  || ((x (int)) mod 60 (format ':99'))
from xxx;

Dieter



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016