Kace reporting SQL query adjustment
05/09/2018 827 views
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"
GROUP BY YEAR(CREATED), MONTH(CREATED),
Be the first to answer this question