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: 4
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: 4  
posted: 7/10/2019 8:37:48 PM(UTC)
235 views and no responses? Does anyone have any suggestions?

Active Discussions

Lansweeper Uptime incorrect
by  CyberCitizen   Go to last post Go to first unread
Last post: Today at 1:29:08 AM(UTC)
Lansweeper Lansweeper Not Saving New Asset
by  Terry1337   Go to last post Go to first unread
Last post: 7/19/2019 3:52:51 PM(UTC)
Lansweeper Email configuration
by  Ian.Prentice  
Go to last post Go to first unread
Last post: 7/19/2019 3:14:04 PM(UTC)
Lansweeper InTune Scanning not showing all devices
by  TBRIT   Go to last post Go to first unread
Last post: 7/19/2019 3:12:03 PM(UTC)
Lansweeper Unique Custom Fields
by  Hendrik.VE  
Go to last post Go to first unread
Last post: 7/19/2019 11:52:35 AM(UTC)
Lansweeper Lansweeper Remote Screenshot Folder
by  Esben.D   Go to last post Go to first unread
Last post: 7/19/2019 10:24:31 AM(UTC)
Lansweeper Lansweeper Enterprise optional?
by  Esben.D  
Go to last post Go to first unread
Last post: 7/19/2019 10:00:22 AM(UTC)