Subject Re: [firebird-support] WHERE and IIF
Author Ismael L. Donis García
That same consultation in Access 2003 it works perfect.
I am trying the change of filter of a consultation according to a given condition.
In these moments am emigrating Access 2003 group of applications to Firebird 2.0.3

Thanks
=========
¦¦ ISMAEL ¦¦
=========
----- Mensaje original -----
De: Leyne, Sean
Para: firebird-support@yahoogroups.com
Enviado: miércoles, 16 de abril de 2008 05:34
Asunto: RE: [firebird-support] WHERE and IIF


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




[Non-text portions of this message have been removed]