Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 10 Dec 2003 @ 14:25:46 GMT


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


Subj:   Re: Concatenating Dates with Times
 
From:   Dieter Noeth

David Clough wrote:

  I seem to remember someone having an efficient method for combining a Date column and a Time column into a Timestamp column; one that didn't involve Casting to Char and use of '||'.  


     cast(datecol as TimeStamp(2))
        + ((timecol - time '00:00:00') hour to second)
     ;

This uses about 5 times less CPU than

     sel
        cast(cast(datecol as char(10)) || ' ' ||
             cast(timecol as char(..)) as TimeStamp(2))

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: 15 Jun 2023