/build/static/layout/Breadcrumb_cap_w.png

Report to see total number of tickets for the year and sort by priority

Hello Im trying to see how I would create a report to get the total number of tickets for the year and sort by priority. It would be nice to be able to get them for a specific queue as well I am not very SQL savy and the wizard hasnt been much help.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: Hobbsy 1 month ago
Red Belt
0

When you say "the total number of tickets for the year" Do you mean the total number of tickets logged in the year or the total number of tickets resolved in a year?


I produced this SQL by using the reporting wizard


SELECT

HD_TICKET.ID,

IF(HD_TICKET.HD_USE_PROCESS_STATUS and HD_TICKET.IS_PARENT, HD_SERVICE_STATUS.NAME, HD_STATUS.NAME) AS STATUS_NAME,

HD_TICKET.CREATED,

HD_TICKET.TIME_CLOSED 

FROM HD_TICKET 

LEFT JOIN HD_SERVICE_STATUS ON HD_TICKET.HD_USE_PROCESS_STATUS and HD_TICKET.HD_SERVICE_STATUS_ID and HD_SERVICE_STATUS.ID = HD_TICKET.HD_SERVICE_STATUS_ID

LEFT JOIN HD_STATUS ON (HD_STATUS.ID = HD_TICKET.HD_STATUS_ID)

WHERE

(HD_TICKET.HD_QUEUE_ID = 1) AND

(((TIMESTAMP(HD_TICKET.CREATED) <= NOW() AND TIMESTAMP(HD_TICKET.CREATED) > DATE_SUB(NOW(),INTERVAL 1 YEAR)))) 

ORDER BY ID, STATUS_NAME


If you were to remove the first line of the WHERE statement, it would give you all Queues

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ