Subject | RE: [firebird-support] Select question |
---|---|
Author | Thomas Clarke |
Post date | 2004-12-08T03:18:39Z |
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
I have a select that includes the following
sl.maxStock - (sl.ShelfQty + sl.SupOrdrQty - sl.CustOrdQty) AS Needed
What i want is this calc value or 0 if it is less than zero, i.e. Needed or
0 whatever is the higher. Is this possible?
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Yahoo! Groups Links
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
I have a select that includes the following
sl.maxStock - (sl.ShelfQty + sl.SupOrdrQty - sl.CustOrdQty) AS Needed
What i want is this calc value or 0 if it is less than zero, i.e. Needed or
0 whatever is the higher. Is this possible?
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Yahoo! Groups Links