/build/static/layout/Breadcrumb_cap_w.png

Kace reporting SQL query adjustment

   I found this query but i want to adjust it so it only pulls data from Queue ID 1. I tried adding HD_TICKET.HD_QUEUE_ID = 1 to the Group by section but only got the month numbers doubled. I am trying to create a report that shows the number of tickets opened per month for the past couple years for a specific Queue. Any help would be greatly appreciated. 

SELECT YEAR(CREATED) AS TicketYears, MONTH(CREATED) AS TicketMonths, COUNT(ID) AS "Opened",
(SELECT COUNT(ID) FROM HD_TICKET WHERE YEAR(TIME_CLOSED) = TicketYears and MONTH(TIME_CLOSED) = TicketMonths) AS "Closed"
FROM ORG1.HD_TICKET
GROUP BY YEAR(CREATED), MONTH(CREATED),

1 Comment   [ + ] Show comment
  • You are nearly there with your query, try adding 'WHERE (HD_TICKET.HD_QUEUE_ID = 1)' just before the GROUP BY syntax - Druis 6 years ago

Answers (0)

Be the first to answer this question

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