Subject RE: [firebird-support] WHERE and IIF
Author Leyne, Sean
Ismael,

> The function the IIF gives me error within the WHERE in the
> equal sign indicated in red. (Second equal sign after
> function IIF --> cofaccob.entidad='2578')
>
> select cofaccob.entidad, cofaccob.docemp, sum(cofaccob.haber)
> as haber from cofaccob where iif(cofaccob.clave='CS',
> cofaccob.entidad='2578', cofaccob.entidad='2580') group by
> cofaccob.entidad, cofaccob.docemp order by cofaccob.docemp

You are using IIF incorrectly, IIF is a shortform for

CASE
WHEN <search_condition> THEN <value1>
ELSE <value2>
END

I'm not sure what you are trying to accomplish, so I can't help further.


Sean