|Subject||Re: [firebird-support] Force NULL to zero in calculation?|
>If you use FB1.5 you can do:No, unfortunately, it's FB 1.0.
> 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...