|
|
Archives of the TeradataForum
Message Posted: Thu, 04 Nov 2004 @ 16:51:59 GMT
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 '('
| |