Notification

Icon
Error

Top 10 users submitting tickets - Top 10 users submitting tickets by month and year

Posted: Wednesday, July 17, 2019 9:29:44 PM(UTC)
LGuth

LGuth

Member Original PosterPosts: 5
0
Like
I would like to have a report showing the top 10 users that have submitted tickets by month and year.
I'm not real savvy on writing code.
Could someone help me?

Linda Guth
====

Maybe this report below that shows the top Ticket Types can be modified to show User Names instead?

Select Top 1000000 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)
ChuckSchurman
#1ChuckSchurman Member Posts: 1  
posted: 8/22/2019 3:53:21 AM(UTC)
Well, what I have is not top 10, it's count by month, 3 month and year, but it's a starting point for ya.



per year
Quote:

Select Top 1000000 htblusers.name As Name,
htblusers.username,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Where htblticket.date > GetDate() - 365
Group By htblusers.name,
htblusers.username,
htblusers.userdomain,
htblticket.fromuserid
Order By Name

Per 3 Month
Quote:

Select Top 1000000 htblusers.name As Name,
htblusers.username,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Where htblticket.date > GetDate() - 90
Group By htblusers.name,
htblusers.username,
htblusers.userdomain,
htblticket.fromuserid
Order By Name

Per current month
Quote:

Select Top 1000000 htblusers.name As Name,
htblusers.username,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Where DatePart(mm, htblticket.date) = DatePart(mm, GetDate()) And
DatePart(yyyy, htblticket.date) = DatePart(yyyy, GetDate()) And
htblticket.spam <> 'True'
Group By htblusers.name,
htblusers.username,
htblusers.userdomain,
htblticket.fromuserid
Order By Name

Active Discussions

Lansweeper Report on clients with no LSAgent
by  RobertB   Go to last post Go to first unread
Last post: Yesterday at 6:55:32 PM(UTC)
Lansweeper Lansweeper report to match computer name
by  RC62N   Go to last post Go to first unread
Last post: 2/19/2020 5:02:27 PM(UTC)
Lansweeper Distinct user logins per PC
by  Bruce Garoutte   Go to last post Go to first unread
Last post: 2/17/2020 6:36:29 PM(UTC)
Lansweeper Software version report issue
by  RC62N  
Go to last post Go to first unread
Last post: 2/17/2020 4:07:20 PM(UTC)
Lansweeper Patch Tuesday - Exclude Win 2008 & Win7
by  doone128   Go to last post Go to first unread
Last post: 2/17/2020 1:34:36 PM(UTC)
Lansweeper Performance statistics combined into one report
by  djs1789  
Go to last post Go to first unread
Last post: 2/15/2020 1:50:32 AM(UTC)