M
mgm
Having a problem getting this to work. I tried isnull to show 0 value when
a count (per year) was none... any ideas? (this is my last case try)
select 'Year - Count' =
case when count(distinct casekey) = 0 then Cast(year(filedate) as
varchar(4)) + '0'
else cast(year(filedate) as varchar(4)) + ' - ' + cast(count(distinct
casekey) as varchar (20)) end
from casemaster (nolock)
where filedate >= @stDate and filedate <= @endDate
and locationid = @locationid
and noscode = @noscode
group by year(filedate)
order by 1
a count (per year) was none... any ideas? (this is my last case try)
select 'Year - Count' =
case when count(distinct casekey) = 0 then Cast(year(filedate) as
varchar(4)) + '0'
else cast(year(filedate) as varchar(4)) + ' - ' + cast(count(distinct
casekey) as varchar (20)) end
from casemaster (nolock)
where filedate >= @stDate and filedate <= @endDate
and locationid = @locationid
and noscode = @noscode
group by year(filedate)
order by 1