Archives of the TeradataForum
Message Posted: Fri, 13 Jul 2007 @ 08:29:21 GMT
Subj: | | Re: varhar(8) to date |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Thursday, July 12, 2007 22:11 -->
Are you saying the VARCHAR field is in yy/mm/dd format?
You need to CAST properly but may need some processing to set century correctly first e.g.
insert into edw_work.vips1(doj)
select
case
when substring(doj from 1 for 2) > '10' /* date range 1911-2010 */
then cast('19'||doj as date format 'yyyy/mm/dd')
else cast('20'||doj as date format 'yyyy/mm/dd')
end
from edw_work.vips;
|