Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 11 Jul 2011 @ 09:28:49 GMT


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


Subj:   Re: Cast date to timestamp
 
From:   Ulrich Arndt

In your example you are dealing with a sting - so you need to cast the date string to date and afterwards the date to a timestamp.

     select cast(cast('2011-07-11' as date) as timestamp(0));

this assumes 'YYYY-MM-DD' date format.


If you need your format try

     select cast(('2011/07/11' (date, format'YYYY/DD/MM')) as timestamp(0))

where you can explicit specify your date format...

If you have already a date column cast(dt_col as timestamp(0)) should work


Ulrich

www.data2knowledge.de



     
  <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