I have count statement but for graph purposes I need to show the count number when it is 0. ATM it only shows if it has counted 1 or greater. Below is my code.
select
count(*) as Total_Resolved ,
cast(year(HE.Entry_date)as char(4)) + cast(CASE WHEN LEN(rtrim(cast(datepart(wk, HE.Entry_date) as char(10)))) < 2 THEN cast(0 as char(1)) + rtrim(cast(datepart(wk,HE.Entry_date) as char(10))) ELSE rtrim(cast(datepart(wk, HE.Entry_date)as char(10))) END as char(2)) as Yr_wk,
C.first_name + ' ' + C.Last_name as Tech
from tech C,
job_ticket J,
History_Entry HE
where C.client_id = J.assigned_tech_id
and J.job_ticket_id = HE.JOB_TICKET_ID
and assigned_tech_id in (2, 5, 7, 16,20,22)
and status_type_id in (3, 4, 5)
AND HE.ENTRY_TEXT Like '%to Resolved%'
select
count(*) as Total_Resolved ,
cast(year(HE.Entry_date)as char(4)) + cast(CASE WHEN LEN(rtrim(cast(datepart(wk, HE.Entry_date) as char(10)))) < 2 THEN cast(0 as char(1)) + rtrim(cast(datepart(wk,HE.Entry_date) as char(10))) ELSE rtrim(cast(datepart(wk, HE.Entry_date)as char(10))) END as char(2)) as Yr_wk,
C.first_name + ' ' + C.Last_name as Tech
from tech C,
job_ticket J,
History_Entry HE
where C.client_id = J.assigned_tech_id
and J.job_ticket_id = HE.JOB_TICKET_ID
and assigned_tech_id in (2, 5, 7, 16,20,22)
and status_type_id in (3, 4, 5)
AND HE.ENTRY_TEXT Like '%to Resolved%'