Subject | Re: field may be null |
---|---|
Author | Dixon Epperson |
Post date | 2004-05-25T16:29:38Z |
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
Dixon Epperson
<m.tonies@u...> wrote:
> Hi Dixon,(SELECT
>
> > in the following statement:
> > (SUM(d.SD_TOTAL) - SUM(d.SD_QTY*p.PR_PRICE)- SUM(d.SD_QTY *
> > x.TX_AMTEA FROM PRTAXCODE xPRODDIF
> > WHERE (x.TX_CODE=d.SD_TAXCODE AND x.TX_CAT=p.PR_CAT)))) AS
> >last
> > x.TX_CAT and x.TX_CODE and x.TX_AMTEA may or may not be NULL.
> >
> > If it is null, I would like to return a value of zero for the
> > subSelect so that the value of this field would be thedifference of
> > (SUM(d.SD_TOTAL) - SUM(d.SD_QTY*p.PR_PRICE) AS PRODDIFThanks Alan and Martijn. Got it working.
> >
> > is this possible to convert a NULL to a zero on the fly?
>
> In Firebird 1.5, use COALESCE.
>
> With regards,
>
> Martijn Tonies
Dixon Epperson