Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Fri, 29 Feb 2008 @ 10:30:02 GMT





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




Subj:   Char to date in teradata
 
From:   gagan.bharadia



Hi,

Could anyone tell me that whether

ORACLE -

     TO_DATE('31-Dec'||TO_CHAR(TO_NUMBER(TO_CHAR(End_Date,'YYYY'))-1))

TERADATA -

     cast('31-dec'||cast(cast(cast(cast(current_date as format 'yyyy')
     as char(4))-1) as integer) as char(4)) as date)

when I try to convert that oracle statement into teradata,than upto char(4) before 'as date', it is working fine but putting one more cast as date gives error 'invalid date'.

In oracle,we easily convert char into date.while doing this thing in teradata it always give error 'invalid date'.

Anyone , tell me the reason as well as help me to sort out the problem.


Thanks & Regards

Gagan Bharadia
Wipro Infotech





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