Subject | Re: [firebird-support] Force NULL to zero in calculation? |
---|---|
Author | Joe Martinez |
Post date | 2004-08-17T17:13:27Z |
>If you use FB1.5 you can do:No, unfortunately, it's FB 1.0.
>
>select
> (
> COALESCE ( saleprice, 0 ) -
> COALESCE ( salecost, 0 ) -
> COALESCE ( -saletradein, 0 )
> ) as Profit
>from sales where saledate = '08/08/04'
>You should define columns like that as NOT NULL and / or use triggers toYes, good point. Unfortunately, that hasn't happened either.
>set them to 0 when insering / updating.
>This will save you a lot of trouble...
-Joe