Subject Re: [firebird-support] Force NULL to zero in calculation?
Author Milan Babuskov
Joe Martinez wrote:
>>If you use FB1.5 you can do:
>>
>>select
>> (
>> COALESCE ( saleprice, 0 ) -
>> COALESCE ( salecost, 0 ) -
>> COALESCE ( -saletradein, 0 )
>> ) as Profit
>
>>from sales where saledate = '08/08/04'
>
> No, unfortunately, it's FB 1.0.

You can use Z() function from rfunc UDF library.

select z(saleprice), z(salecost), z(-saletradein) ... etc.

URL:

http://rfunc.sourceforge.net

--
Milan Babuskov
http://www.flamerobin.org