Archives of the TeradataForum
Message Posted: Tue, 30 Oct 2012 @ 19:11:40 GMT
Subj: | | Re: Date conversion not working |
|
From: | | Anomy Anom |
< -- Anonymously Posted: Tuesday, October 30, 2012 10:11 -- >
Hi,
Thanks for your answers. I have already tried using date as below but is not working
sel
cast(cast(emp_dt as date format 'mm/dd/yyyy') as date format 'yyyy/mm/dd') "dt"
from tblname
where dt= date;
I also tried casting date/current_date in where clause, but somehow it is still not working and giving the same error (invalid date).
Even our date default is yyyy/mm/dd
sel
cast(cast(emp_dt as date format 'mm/dd/yyyy') as date format 'yyyy/mm/dd') "dt"
from tblname
where dt= cast(current_date as date format 'yyyy/mm/dd');
|