Hi there fellow IT Ninja's

I'm looking into a way to create a report that displays the total tickets closed by a ticket owner on a weekly basis with a final overall total ticket count.
I found a post which has a sql query that does pretty much what I'm after but with little to no sql knowledge im not sure how to re-jig it.

What would I need to change to make the below query display ticket owners instead of categories?

The sql report i found used this query:

SELECT
HD_CATEGORY.NAME AS 'Category',
COUNT(HD_TICKET.TITLE) as 'Count of Tickets'
FROM
HD_TICKET,
HD_CATEGORY
WHERE
HD_TICKET.HD_CATEGORY_ID = HD_CATEGORY.ID
AND (HD_TICKET.HD_QUEUE_ID = 1)
AND HD_TICKET.CREATED >= (CURDATE() - INTERVAL 7 DAY)
group by CATEGORY
UNION Select
'TOTAL', count(HD_TICKET.ID)
FROM
HD_TICKET,
HD_CATEGORY
WHERE
HD_TICKET.HD_CATEGORY_ID = HD_CATEGORY.ID
AND (HD_TICKET.HD_QUEUE_ID = 1)
AND HD_TICKET.CREATED >= (CURDATE() - INTERVAL 7 DAY)
 
(Link to original post: http://www.itninja.com/question/total-count-report-for-kace-sd-tickets)
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0
Did you mean this one?

SELECT OWNER_ID, count(*) as TicketCounter
  FROM HD_TICKET
 WHERE HD_TICKET.CREATED >= (CURDATE() - INTERVAL 7 DAY)
GROUP BY OWNER_ID
Answered 05/26/2015 by: aragorn.2003
Red Belt

  • That looks like what im roughly after just a quick question will this display only the closed tickets?
Please log in to comment
Answer this question or Comment on this question for clarity