Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 04 Nov 2004 @ 17:07:11 GMT


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


Subj:   Re: Hard Coded Date in a Case Statement Issue
 
From:   David Wellman

Clay,

Try the following

     Select   Case  when (ColA = 1 and ColB is not null)
                 then  ColC
                 else  cast('2004-05-05' as date format 'yyyy-mm-dd')
           End
     >From     Clay_Case_Date;

or

     Select   Case  when (ColA = 1 and ColB is not null)
                 then  ColC
                 else  cast(1040505 as date )
           End
     >From     Clay_Case_Date

Basically, any CAST statement with an appropriately formatted date value.


Cheers,

Dave



     
  <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