cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nick_VDB
Champion Sweeper III
Added in v.6.0.100

The report below lists the percentages of tickets that have come into the helpdesk based on the type of the ticket during the current month.

The report will only list tickets that meet all of the following criteria:
  • The ticket has not been set to ‘Ignore’.
  • The ticket was created this month.


Select Top 1000000 DateName(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' And DatePart(yyyy, htblticket.date) =
DatePart(yyyy, GetDate()) And DatePart(mm, htblticket.date) = DatePart(mm,
GetDate())
Group By DateName(mm, htblticket.date),
htbltickettypes.typename,
DatePart(mm, htblticket.date),
htbltickettypes.icon,
TicketCount.Amount
Order By DatePart(mm, htblticket.date),
Type
0 REPLIES 0