Where did ticket breach SLA?

Where did ticket breach SLA?

Hi,
I am looking for a report which shows how many SLA each  Support group breached, not how many breached SLA each Support group own.
To my understanding this should be possible in ServideDesk Plus 9 MSP.

We have previously used this query

SELECT qd.QUEUENAME "Group",
count(wo.WORKORDERID) "Total Request",
count(case when std.ISPENDING='0' THEN 1 ELSE NULL END) "Completed Requests" ,
count(case when (std.ISPENDING='0' AND wos.ISOVERDUE='1') THEN 1 ELSE NULL END) "SLA violated",
count(case when (std.ISPENDING='0' AND wos.ISOVERDUE='0') THEN 1 ELSE NULL END) "SLA not violated" ,
case when count(case when std.ISPENDING='0'THEN 1 ELSE NULL END) > 0 then count(case when (std.ISPENDING='0' and wos.ISOVERDUE='1') THEN 1 ELSE NULL END) *100 / count(case when std.ISPENDING='0'THEN 1 ELSE NULL END) else null end "% Violated",
case when count(case when std.ISPENDING='0'THEN 1 ELSE NULL END) > 0 then count(case when (std.ISPENDING='0' and wos.ISOVERDUE='0') THEN 1 ELSE NULL END) *100 / count(case when std.ISPENDING='0'THEN 1 ELSE NULL END) else null end "% not Violated" FROM WorkOrder wo
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN StatusDefinition std on wos.statusid=std.statusid
LEFT JOIN SDUser td ON wos.OWNERID=td.USERID
LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID
LEFT JOIN WorkOrder_Queue woq ON wo.WORKORDERID=woq.WORKORDERID
LEFT JOIN QueueDefinition qd ON woq.QUEUEID=qd.QUEUEID
WHERE (wo.ISPARENT='1') and wo.COMPLETEDTIME >= <from_lastweek> AND wo.COMPLETEDTIME <= <to_lastweek> GROUP BY qd.QUEUENAME

But this only shows how many breached SLA each  Support group own/has, not how many they actually breached. 


Database: MSSQL

                New to ADSelfService Plus?