Subject Re: [firebird-support] Select question
Author Robert martin
Thanks Thomas

That works like a charm !
I did not know that you could do Case statements in SQL, it's great!

Just out of interest. Does anybody know if there much of a performance hit in doing this sort of thing?

Rob Martin
Software Engineer

phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
----- Original Message -----
From: Thomas Clarke
To: firebird-support@yahoogroups.com
Sent: Wednesday, December 08, 2004 4:18 PM
Subject: RE: [firebird-support] Select question


Rob,

If my sql is right then something like this should work. It is untested as
it is late at night here so don't take my word for it.

select
case
when sl.maxStock - (sl.ShelfQty + sl.SupOrdrQty - sl.CustOrdQty) >= 0
then sl.maxStock - (sl.ShelfQty + sl.SupOrdrQty - sl.CustOrdQty)
else 0
end AS Needed
...

Thomas Clarke.

-----Original Message-----
From: Robert martin [mailto:rob@...]
Sent: Tuesday, December 07, 2004 11:09 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Select question



Hi

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