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 Scan timeout... How long?
by  RobertB   Go to last post Go to first unread
Last post: Yesterday at 11:23:30 PM(UTC)
Lansweeper Lansweeper support levels
by  aldo22  
Go to last post Go to first unread
Last post: Yesterday at 9:31:00 PM(UTC)
Lansweeper selection of database for migration
by  aldo22   Go to last post Go to first unread
Last post: Yesterday at 9:25:36 PM(UTC)
Lansweeper Deployment Threads
by  RobertB  
Go to last post Go to first unread
Last post: Yesterday at 5:06:47 PM(UTC)
Lansweeper Bulk remove old domain users from Lansweeper
by  Erik.T   Go to last post Go to first unread
Last post: Yesterday at 3:42:00 PM(UTC)
Lansweeper Weekly tasks
by  LithiumKid1976  
Go to last post Go to first unread
Last post: Yesterday at 3:29:56 PM(UTC)
Lansweeper Bulk user deletion
by  Erik.T   Go to last post Go to first unread
Last post: Yesterday at 9:36:03 AM(UTC)
Lansweeper Tracking assets like docking station, mouse and keyboards
by  CyberCitizen  
Go to last post Go to first unread
Last post: Yesterday at 2:43:18 AM(UTC)