Subject | SUM function returns NULL if no Records, Need it to return 0 |
---|---|
Author | Anthony Tanas |
Post date | 2006-08-06T23:50:30Z |
Hi,
I have a query where I am using a HAVING clause, such as:
HAVING
SUM(AMOUNT) > 0
But the problem is if there are no records tabulated in the aggregate
function the function returns NULL. This prevents records from being
fetched. I need it to return 0. What should I do?
Thanks.
I have a query where I am using a HAVING clause, such as:
HAVING
SUM(AMOUNT) > 0
But the problem is if there are no records tabulated in the aggregate
function the function returns NULL. This prevents records from being
fetched. I need it to return 0. What should I do?
Thanks.