Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Sep 2004 @ 12:06:18 GMT


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


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.



     
  <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: 15 Jun 2023