 |
 |
Archives of the TeradataForum
Message Posted: Tue, 21 Sep 2004 @ 12:06:18 GMT
Subj: | | Re: Comparing varchar and date columns |
|
From: | | Vidyasagar_Nagarajan |
Dear Srikant,
I think this could help U.
1) create table temp(dt date format 'YYYY-MM-DD)
insert into temp( CAST('2003-05-15' AS DATE FORMAT 'YYYY-MM-DD'))
insert into temp( CAST('2003-05-16' AS DATE FORMAT 'YYYY-MM-DD'))
2) create table temp1(dt varchar(11))
insert into temp1('17-MAY-2003')
insert into temp1('15-MAY-2003')
select a.dt from
temp a INNER JOIN temp1 b
ON cast(B.dt as date FORMAT 'DD-MMM-YYYY') = CAST(A.DT AS DATE FORMAT
'YYYY-MM-DD')
Ans : - DT = 2003-05-15
Regards,
Vidya Sagar.N
Satyam Computer Services Ltd.
| |