Creating a report with multiple day intervals
I have 3 reports set up that list the amount of tickets that are older than 14, 30 and 60 days. I would like to combine those 3 intervals in to one report have the intervals labeled something like 14-29, 29-59, etc. is this even possible?
Here is the SQL that I am currently using.
SELECT HD_QUEUE.NAME as Queue, IFNULL(USER.USER_NAME,'-Unassigned-') as Owner,
count(HD_TICKET.ID) as "Open Tickets older than 14 Days"
JOIN HD_STATUS on (HD_STATUS.ID = HD_TICKET.HD_STATUS_ID)
JOIN HD_QUEUE on HD_QUEUE.ID = HD_TICKET.HD_QUEUE_ID
LEFT JOIN USER on (USER.ID = HD_TICKET.OWNER_ID)
where HD_STATUS.NAME NOT LIKE '%Closed%'
and HD_TICKET.TIME_OPENED < DATE_SUB(NOW(), INTERVAL 14 DAY)
and HD_TICKET.HD_QUEUE_ID in (2,3,4,10,12) /*add queue numbers here*/
GROUP BY QUEUE, OWNER