Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 20 Jul 2006 @ 09:35:46 GMT


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


Subj:   Re: Most efficient way to add hours to a date field?
 
From:   Dieter Noeth

Vivek Pandey wrote:

  What is the most efficient way to add hours as integer to a date field? I have 2 columns one is integer and another as time and I need to add them. I know that I can use the extract function and do MOD to perform the same in a conditional statement. Is there any better way?  


     select timecol + (intcol * interval '1' hour)

If intcol exceeds 9999 then use:

     intcol * interval '0000 ?01' day to hour

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