Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 14 Aug 2007 @ 18:49:36 GMT


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


Subj:   Re: CASTing to lesser precision
 
From:   Dieter Noeth

Anomy.Anom wrote:

  I like to cast a timstamp field to the lesser precision, the manual says, its not allowed.  


Stupid, isn't it?


  Is there a workaround for it, or how is it been done in real time, when its required.  


     SELECT CAST(CAST(CURRENT_TIMESTAMP(6) AS CHAR(19)) AS TIMESTAMP(0));

If you run in ANSI mode it's even worse:

     SELECT CAST(SUBSTRING(CAST(CURRENT_TIMESTAMP(6) AS CHAR(26)) FROM 1 FOR 19) AS TIMESTAMP(0));

If you don't want that cast then the only solution is to define just the necessary precision :-(


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