‎08-09-2017 12:02 PM
Select Top 1000000 DatePart(yyyy, htblticket.date) As Year,
DatePart(mm, htblticket.date) As Month,
htbltickettypes.typename Type,
htblusers.name As AssignedAgent,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblagents On htblagents.agentid = htblticket.agentid
Inner Join htblusers On htblusers.userid = htblagents.userid
Inner Join htbltickettypes On htbltickettypes.tickettypeid =
htblticket.tickettypeid
Group By DatePart(yyyy, htblticket.date),
DatePart(mm, htblticket.date),
htbltickettypes.typename,
htblusers.name
Order By Year Desc,
Month Desc,
Type,
AssignedAgent
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now