Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 25 Jan 2002 @ 17:25:50 GMT


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


Subj:   Re: How to do timestamp arithmetic
 
From:   Sauli Harala

Hi,

This must be a Teradata FAQ...

In our current version I guess that this is the simpliest.

This should give difference of two timestamp(0) fields from my_table as a difference and as seconds.

select ((my_2_timestamp_as_0 - my_1_timestamp_as_0) DAY(4) TO SECOND) AS diff_time,

((EXTRACT (DAY FROM diff_time) * 24 * 60 * 60) +
EXTRACT (HOUR FROM diff_time) * 60 * 60 +
EXTRACT (MINUTE FROM diff_time) * 60 +
EXTRACT (SECOND FROM diff_time)) AS tdTime from my_table;


Regards,

sh



     
  <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