Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Field selection conditions
Fri, Nov 28 2008 5:45 AMPermanent Link

Lelsie
Hi,

Is there any other way to use conditions for field selection in a select query beside
coalesce? I remember seeing such example somewhere in the forums, but cannot find it and
there is no sign of it in the documentation either, so I must be wrong.

I mean something  like:

Select  
iif(Field1>1, Field1, Field2 ) as Field4
from ...

or

Select  
case
 when Field1>1 ...
from ...

Regards,
Leslie
Fri, Nov 28 2008 6:17 AMPermanent Link

"John Hay"
Lelsie

> Is there any other way to use conditions for field selection in a select
query beside
> coalesce? I remember seeing such example somewhere in the forums, but
cannot find it and
> there is no sign of it in the documentation either, so I must be wrong.
>
> I mean something  like:
>
> Select
> iif(Field1>1, Field1, Field2 ) as Field4
> from ...

Check out the following link for the "If" systax.

http://www.elevatesoft.com/manual?action=mantopic&id=edb2sql&category=13&topic=225

John

Fri, Nov 28 2008 6:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Lelsie


I don't know about CASE but you were almost there with iif Smiley

Here's a couple of examples

IF(J._MainPhone IS NOT NULL  THEN J._MainPhone
ELSE  Site._Switchboard) AS _MainPhone,

IFNULL(W._LatestCV THEN FALSE ELSE TRUE) AS _HasCV


Roy Lambert [Team Elevate]
Fri, Nov 28 2008 7:01 AMPermanent Link

Leslie
John & Roy,

Thank you very much for the quick help. Smile

Leslie
Mon, Dec 1 2008 9:27 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Leslie,

<< I mean something  like:

Select
iif(Field1>1, Field1, Field2 ) as Field4
from ...

or

Select
case
 when Field1>1 ...
from ... >>

Yes, you can use either syntax.  Just change the IIF() to IF().

--
Tim Young
Elevate Software
www.elevatesoft.com

Image