nickwilliams999 Posted January 24, 2020 Share Posted January 24, 2020 Hi, In the interest of sharing, I just thought I would share some code I have written to find out the amount of time it took to respond to a ticket, excluding and auto-response. SELECT t.id AS TicketID, t.title, t.message, t.status, t.urgency, t.date, ttr.tid, ttr.message, MIN(ttr.date) AS TicketReplyDate, TIMEDIFF(ttr.date, t.date) AS FirstResponseTime FROM tblticketreplies ttr JOIN tbltickets t ON ttr.tid = t.id WHERE ttr.message NOT LIKE '%Thanks for reaching out!%' GROUP BY ttr.tid ASC In addition to this, I also converted the FirstResponseTime to an integer within my reporting tool, this was outside of the SQL code: FirstResponseDurationInMinutes = DATEDIFF('Support Ticket Response Times'[date], 'Support Ticket Response Times'[TicketReplyDate], MINUTE) FirstResponseDurationInHours = 'Support Ticket Response Times'[FirstResponseDurationInMinutes] / 60 This is certainly a requirement in KPI reports we run, so hopefully someone finds this useful! Nick 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.