Notification

Icon
Error

Calls closed within SLA - I need this report modifying so it shows all calls in this current month

Posted: Tuesday, April 13, 2021 5:25:38 PM(UTC)
TimHolmes1973

TimHolmes1973

Member Original PosterPosts: 35
0
Like
My SQL is not upto scratch, and I found this code, but would like it to just run for this current month.
Here is the code and

Select Top 1000000 htblteams.teamname As team,
totalTickets.totalCount As [All Closed Tickets],
onTimeTickets.onTimeCount As [All Closed on Time],
Convert(DECIMAL(16,2),((onTimeTickets.onTimeCount * 1.0) /
(totalTickets.totalCount * 1.0))) * 100 As Percentage
From htblteams
Inner Join (Select htblticketteam.teamid As teamIdAll,
Count(htblticket.ticketid) As totalCount
From htblticket
Inner Join htblticketteam On htblticketteam.ticketid =
htblticket.ticketid
Where htblticket.slaresolved Is Not Null And htblticket.ticketstateid = 1
Group By htblticketteam.teamid) As totalTickets On
totalTickets.teamIdAll = htblteams.teamid
Inner Join (Select htblticketteam.teamid As teamIdOnTime,
Sum((Case
When lastCloseDate.mdate < htblticket.slaresolved Then 0
When lastCloseDate.mdate = '1900-01-01 00:01:00.000' Then 1
Else 1
End)) As onTimeCount
From htblticket
Inner Join (Select Max(htblhistory.date) As mdate,
htblhistory.ticketid As mticket
From htblhistory
Where htblhistory.ticketstateid = 1
Group By htblhistory.ticketid) As lastCloseDate On
lastCloseDate.mticket = htblticket.ticketid
Inner Join htblticketteam On htblticketteam.ticketid =
htblticket.ticketid
Where htblticket.slaresolved Is Not Null
Group By htblticketteam.teamid) As onTimeTickets On
onTimeTickets.teamIdOnTime = htblteams.teamid

here is where I got it from.

https://www.lansweeper.c...ithin-SLA.aspx#post49564

Active Discussions

Lansweeper Using tblO365User report for devices Out of warranty
by  QueryLSTech   Go to last post Go to first unread
Last post: Yesterday at 5:15:37 PM(UTC)
Lansweeper Duplicate assets, random monitor unique keys
by  kloosterd  
Go to last post Go to first unread
Last post: Yesterday at 1:00:34 PM(UTC)
Lansweeper Scanning - nothing appears in the queue
by  LS IT Admins   Go to last post Go to first unread
Last post: Yesterday at 11:08:22 AM(UTC)
Lansweeper Broken scanning of AD
by  LS IT Admins  
Go to last post Go to first unread
Last post: Yesterday at 10:59:35 AM(UTC)
Lansweeper New ticket auto-assignment & default state
by  Brandon   Go to last post Go to first unread
Last post: 5/13/2021 5:21:31 PM(UTC)
Lansweeper Automatic Follow-Up for Tickets
by  Francis Lee Mondia - Endace  
Go to last post Go to first unread
Last post: 5/12/2021 11:06:51 PM(UTC)
Lansweeper Can't see devices on Lansweeper
by  vqT4cDoP9iXyMZwoDUWU   Go to last post Go to first unread
Last post: 5/12/2021 8:33:21 PM(UTC)
Lansweeper LAPS managed password
by  SystemAdmin  
Go to last post Go to first unread
Last post: 5/12/2021 6:08:42 PM(UTC)