Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 30 Oct 2012 @ 09:20:09 GMT


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


Subj:   Date conversion not working
 
From:   Anomy Anom

< -- Anonymously Posted: Monday, October 29, 2012 20:27 -- >

Hi,

We have date stored in format "mm/dd/yyyy' with datatype VC(20). I want to perform some date conversions on this col and so trying to cast the data to date. Below query is working fine

     sel
     cast(cast(emp_dt as date format 'mm/dd/yyyy') as date format 'yyyy/mm/dd') "dt"
     from tblname

But when I add a where clause, it is failing with error "Invalid date". Can some one help me identify the issue

     sel
     cast(cast(emp_dt as date format 'mm/dd/yyyy') as date format 'yyyy/mm/dd') "dt"
     from tblname
     where dt=current_date

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