Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Thu, 24 Jan 2008 @ 23:11:06 GMT





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




Subj:   Re: Cast Behavior Between 6.1 and 6.2
 
From:   Mutsch, Joerg



Tony,

This has never worked (at least not for me). Teradata is cutting the leading zero so you have to provide a format on which you would like to cast.

Try this one:

     CAST ( CAST( ( extract (month from cast(DATE_FIELD as DATE  FORMAT
     'YYYYMMDD') ) )  AS DECIMAL(2) FORMAT '99')AS CHAR(2)) AS MONTH_ID

It's not elegant but it works :)


Joerg





     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 01 Dec 2008