Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 04 Nov 2004 @ 16:51:59 GMT


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


Subj:   Hard Coded Date in a Case Statement Issue
 
From:   Claybourne Barrineau

Anyone, please...

How in the ?!@#* can I default a hard-coded date value in a case statement? We are on V2R5.0.1.27.


Thanks,

Clay


     Create Table Test_Space.Clay_Case_Date
     (
     ColA integer not null
     ,ColB integer not null
     ,ColC Date not null
     )

     Insert into Test_Space.Clay_Case_Date Values (1,2,1000101);

     First Try
     Select   Case  when (ColA = 1 and ColB is not null)
                 then  ColC
                 else  '2004-05-05'
           End
     From     Test_Space.Clay_Case_Date

     3800: Datatype Mismatch

     Second Try
     Select   Case  when (ColA = 1 and ColB is not null)
                 then  ColC
                 else  1040505
           End
     From     Test_Space.Clay_Case_Date

     3800: Datatype Mismatch

     Third Try
     Select   Case  when (ColA = 1 and ColB is not null)
                 then  ColC
                 else  '2004-05-05' (date, format 'yyyy-mm-dd')
           End
     From     Test_Space.Clay_Case_Date

     3707 Syntax error, expected something like an 'END' keyword between astring and '('


     
  <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