Subject RE: [firebird-support] Datatypes are not comparable in expression CASE when using TIMESTAMPS
Author Maya Opperman
>> Mark Rotteveel wrote:
>>If both are DATE or both are TIMESTAMP everything is OK. When one is a DATE and the other is a TIMESTAMP it breaks down

Aha, thanks, have fixed by casting the timestamp to a date:

when ((p.StartDate <= cast('Today' as date)) and (p.EndDate >= cast('Today' as date))) then
(cast('Today' as date) + 1)
(cast(p.enddate as date) + 1)

As you say, my other workaround probably shouldn't have worked either. Strange, but at least mystery is solved, thanks ;-)