Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread SELECT as expression for IF
Fri, Jan 19 2007 7:15 AMPermanent Link

Thad
I've tried to do a statment like ...

select
 othertable.field,
 if ( (select count(field) from table where condition) > 0 THEN 'result' ELSE 'not result')
from
 othertable
where
 condition


Is it not possible to use a select statment as a way to create an expression, for an if function? Even if I took out the other table, and just try to do a select for an expression, I can't get it to
work.

Thanks
Fri, Jan 19 2007 7:19 AMPermanent Link

Thad
Thad <thollingsworth@paychex.com> wrote:

I've tried to do a statment like ...

select
 othertable.field,
 if ( (select count(field) from table where condition) > 0 THEN 'result' ELSE 'not result')
from
 othertable
where
 condition


Is it not possible to use a select statment as a way to create an expression, for an if function? Even if I took out the other table, and just try to do a select for an expression, I can't get it to
work.

Thanks


By the way, its DBISAM 4.x and Delphi 2005
Fri, Jan 19 2007 3:34 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thad,

<< Is it not possible to use a select statment as a way to create an
expression, for an if function? Even if I took out the other table, and just
try to do a select for an expression, I can't get it to work.  >>

Not in DBISAM, no.  You can only use SELECT expressions with an IN or NOT IN
operator in DBISAM.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image