Subject Re: [firebird-support] Datatypes are not comparable in expression CASE - BUGG?
Author Helen Borrie
At 03:52 AM 8/12/2008, you wrote:
>Dear all,
>I recently tried a certain select query on a firebird 2.1 database
>engine (on windows xp ­ service pack 2) with both firebird maestro
>and ibexpert development software
>This one fails
>Case TABLE_VACC.Vacc_1_D
>When Null
>(select VACC_1_INT from TABLE_VACCPROT where
>(select birthday from TABLE_COWS where TABLE_COWS.cowregnumber =
>TABLE_VACC.CowRegNumber )
>Else TABLE_VACC.Vacc_1_D
>When I drop the else statement it fails strangely enough and reports
>an error as
>"Datatypes are not comparable in expression CASE"
>This is quite surprising as both statements are dates,

But the exception is saying otherwise: it appears that TABLE_VACC.Vacc_1_D is a TIMESTAMP and the mismatch occurs because the DATEADD() expression returns a DATE. What are the ODS and Dialect of the database?