Link to home
Start Free TrialLog in
Avatar of DeniseGoodheart
DeniseGoodheart

asked on

COALESCE and ISNULL Functions Not Returning 0 Value

Hi,

I'm using SQL Server 2000.  I would like my RecordCount column to return a 0 value.  The RecordCount is a numeric value.  I've tried the COALESCE and IsNull functions with no success as follows:


SELECT     COUNT(COALESCE (ItemCount, 0)) AS RecordCount
FROM         dbo.CAR_SummaryTable
GROUP BY ItemCategory
HAVING      (ItemCategory = 'Unincorp Central Region')


SELECT     COUNT(ISNULL(ItemCount, 0)) AS RecordCount
FROM         dbo.CAR_SummaryTable
GROUP BY ItemCategory
HAVING      (ItemCategory = 'Unincorp Central Region')

Any Suggestions?
Thanks,
Denise
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image


SELECT     ISNULL(COUNT(ItemCount), 0) AS RecordCount
FROM         dbo.CAR_SummaryTable
GROUP BY ItemCategory
HAVING      (ItemCategory = 'Unincorp Central Region')
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DeniseGoodheart
DeniseGoodheart

ASKER

Hi ExpertAdmin,

No, I was missing the point.  I'm working on a project where the project due date is based on the budget due date, and not the actual time required for the project.  In any event, sometimes I lose perspective in what I'm doing because I'm trying to meet the aggressive project due date!  I am so thankful for Experts Exchange!

Many Thanks,
Denise
Hi angelIII:

Many thanks for your useful information!

Denise
Anytime. Glad I could help. I have been on a few of those projects myself.

M@