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)
Please log in to answer
Be the first to answer this question