Archives of the TeradataForum
Message Posted: Tue, 30 Oct 2012 @ 09:20:09 GMT
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
|