I have this as my SQL statement and it works great but can't seem to get it to work for just specific technicians

SELECT USER.USER_NAME as OWNER, count(HD_TICKET.ID) as NUMBER_OF_TICKETS,
ROUND((AVG(TIMESTAMPDIFF(DAY, 
                          HD_TICKET.CREATED, 
                          TIME_CLOSED)
           )), 1) AS "Avg Days Open"
from HD_TICKET
JOIN HD_STATUS on (HD_STATUS.ID = HD_TICKET.HD_STATUS_ID)
LEFT JOIN USER on (USER.ID = HD_TICKET.OWNER_ID)
where HD_STATUS.STATE ='closed'
and HD_TICKET.TIME_CLOSED > DATE_SUB(NOW(), INTERVAL 30 DAY)
and HD_TICKET.HD_QUEUE_ID in (1) /*add queue numbers here*/
GROUP BY OWNER
2 Comments   [ + ] Show Comments

Comments

  • Hard code the names
  • I have done this in the past for other reports but for some reason on this one I keep getting SQL error message with multiple names and if I use 1 name I get zero data
    • Post your query that fails, please.
Please log in to comment

Answers

0
How do you want to select the technicians? It can be static and you can hard code the names, or you can use a label to make it dynamic.

Answered 11/14/2017 by: chucksteel
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share