Subject | Re: [firebird-support] Datatypes are not comparable in expression CASE - BUGG? |
---|---|
Author | Helen Borrie |
Post date | 2008-12-07T22:03:11Z |
At 03:52 AM 8/12/2008, you wrote:
./heLen
>Dear all,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?
>
>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
>
>select
>Case TABLE_VACC.Vacc_1_D
>When Null
>Then DATEADD(
>day,
>(select VACC_1_INT from TABLE_VACCPROT where
>TABLE_VACCPROT.ProtocolID = TABLE_VACC.VACCPROTOCOL),
>(select birthday from TABLE_COWS where TABLE_COWS.cowregnumber =
>TABLE_VACC.CowRegNumber )
>)
>Else TABLE_VACC.Vacc_1_D
>End
>from
>TABLE_VACC;
>
>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,
./heLen