Query to show technician total tickets and SLA violated percentage. (MSSQL & PGSQL)

Query to show technician total tickets and SLA violated percentage. (MSSQL & PGSQL)

Tested in Build PGSQL (14300) or MSSQL (14306)


Go to Reports- New Query Report and execute this query.


select aaau.first_name "Tech Name",
count (wo.workorderid) "Total No. of Requests/Incidents",
count(case when wos.ISOVERDUE='1' THEN 1 ELSE NULL END) "Total Overdue Tickets",
sum(CASE WHEN wos.ISOVERDUE = '1' THEN 1 ELSE 0 END) * 100 / Count(wo.workorderid) AS "Violation %" from workorder wo 
left join workorderstates wos ON wo.workorderid=wos.workorderid 
left join aaauser aaau ON wos.ownerid=aaau.user_id
WHERE (wo.ISPARENT='1') and wo.CREATEDTIME >= <from_lastmonth> AND wo.CREATEDTIME <= <to_lastmonth>
group by aaau.first_name

                  New to ADSelfService Plus?