Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 05 May 2010 @ 18:17:28 GMT


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


Subj:   Timestamp Calculations for an Oracle to Teradata
 
From:   Anomy Anom

<-- Anonymously Posted: Wednesday, May 05, 2010 14:10 -->

Hi -

I am working on Some Oracle to Teradata migration :

1.) Oracle Function : select trunc(sysdate,'MI') , SYSDATE FROM DUAL

Result: is 2010-05-05 13:39:00 , 2010-05-05 13:39:23

To achieve this in Teradata:

     sel cast(cast( Current_timestamp as char(16) ) || ':00' as timestamp(0) )

2.) select sysdate, trunc( (sysdate + 241/24 ), 'MI' )from dual

Results: 5/5/2010 5:48:46 PM, 5/15/2010 6:48:00 PM

241 is hours: 241/24 = 10 days 1 hour - Adding it to the current_timestamp


Thinking to achieve this using SUBSTRING and MOD in Teradata.

Any simpler ways to achieve the above conversions?


Thanks-



     
  <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