Subject | Re: [firebird-support] putting zero value on null field in select sql |
---|---|
Author | Milan Babuskov |
Post date | 2003-12-18T07:35:35Z |
James wrote:
--
Milan Babuskov
http://fbexport.sourceforge.net
> I have a sql like thisI'm using Z() UDF from rfunc library for this.
>
> select m.ID, m."Expense", m."SubExpense", (d."TotalAmount" *
> (1-(d."Discount"*0.01)) * (1-(d."Discount2"*0.01)) *
> (1-(d."Discount3"*0.01)) - d."Less" - d."Adjustment") as "GrandTotal"
> from "expensesubtype" m left join "invoice" d on m.ID = d."ExpenseCategory"
>
> What happen is if I have no record in the invoice table that mathes in
> the expensesubtype the "GrandTotal" is null. How do I replace the null
> with zero? Iam trying to avoid using SP
--
Milan Babuskov
http://fbexport.sourceforge.net