Subject Sub query returns NULL
Author moegamata

I have a problem in that my subquery returns a null value despite the fact that I have it wrapped in a coalesce ... What am I missing?

Many thanx


sum(w.EXTENDED) SalesTotal,
sum(w.DISCOUNT) Discounts,

(select a.roundloss
FROM round_v a
where a.salesdate = z.salesdate) as RoundLoss,

(select coalesce(a.CreditSales,0)
FROM crdsales_v a
where a.salesdate = z.salesdate) as CreditSales,

FROM asales z,sales v,salesitems w,salestype x
where z.salesdate between :sdate and :edate
group by z.salesdate