The following query results value as single row either as value for ExtendedText
or zero for matching LineNumber
in the table data. I need to add one more condition in the query as - if the LineNumber
doesn't exist return one row as zero as same in the case of null. The query should check both for NULL
and empty to return zero
SELECT ISNULL(Sum(convert(dec,DeliveryPaymentExtras.ExtendedText)),0) As ExtendedText
FROM DeliveryPaymentExtras
WHERE (LineNumber =21) group by LineNumber