Notification

Icon
Error

Top 10 Ticket Types Year To Date - Report Creation

Posted: Wednesday, June 26, 2019 6:36:06 PM(UTC)
LGuth

LGuth

Member Original PosterPosts: 5
0
Like
I found this code, but it only shows me the current month.
How do I edit it, so that it shows the top 10 ticket types for Year To Date for the current year?

Select Top 10 DatePart(yyyy, htblticket.date) As Year,
DatePart(mm, htblticket.date) As Month,
'../helpdesk/icons/' + htbltickettypes.icon As icon,
htbltickettypes.typename As Type,
Count(htblticket.ticketid) As TicketCount,
Cast((Count(htblticket.ticketid) / Cast(TicketCount.Amount As decimal) *
100) As decimal(10,2)) As [Type%]
From htblticket
Inner Join htbltickettypes On htbltickettypes.tickettypeid =
htblticket.tickettypeid
Inner Join (Select DatePart(yyyy, htblticket.date) As Year,
DatePart(mm, htblticket.date) As Month,
Count(htblticket.ticketid) As Amount
From htblticket
Where htblticket.spam <> 'True'
Group By DatePart(yyyy, htblticket.date),
DatePart(mm, htblticket.date)) As TicketCount On TicketCount.Year =
DatePart(yyyy, htblticket.date) And TicketCount.Month = DatePart(mm,
htblticket.date)
Where htblticket.spam <> 'True'
Group By DatePart(yyyy, htblticket.date),
DatePart(mm, htblticket.date),
htbltickettypes.typename,
htbltickettypes.icon,
TicketCount.Amount
Order By Year Desc,
Month Desc,
Type
LGuth
#1LGuth Member Original PosterPosts: 5  
posted: 7/10/2019 8:37:48 PM(UTC)
235 views and no responses? Does anyone have any suggestions?

Active Discussions

Lansweeper Default tabs not being deleted.
by  RobertB   Go to last post Go to first unread
Last post: Yesterday at 11:34:50 PM(UTC)
Lansweeper SCCM - Overrighting Lansweeper Info
by  The Boss  
Go to last post Go to first unread
Last post: Yesterday at 9:39:00 PM(UTC)
Lansweeper Windows Defender AV
by  Mikey!   Go to last post Go to first unread
Last post: Yesterday at 6:23:02 PM(UTC)
Lansweeper Changes in the licensing model
by  BullGates   Go to last post Go to first unread
Last post: Yesterday at 4:17:46 PM(UTC)
Lansweeper User deletion requirements
by  Adam Poole  
Go to last post Go to first unread
Last post: Yesterday at 2:45:58 PM(UTC)