Subject Re: [firebird-support] Force NULL to zero in calculation?
Author Joe Martinez
>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 should define columns like that as NOT NULL and / or use triggers to
>set them to 0 when insering / updating.
>This will save you a lot of trouble...

Yes, good point. Unfortunately, that hasn't happened either.

-Joe