What is the correct SQL for running a report that counts all tickets where Queue name = Help Desk, that have been created after a specific time of day (ie. 3:00pm) Ordered by Month?
I am new to SQL and have a special request for a report to determine if Help Desk hours need to change during certain times of the year. Thanks for any and all help.
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
aragorn.2003
9 years ago
Did you mean this resultset?
select count(*) as TotalTicketCount
from HD_TICKET as t, HD_QUEUE as q
where t.HD_QUEUE_ID = q.ID
and q.NAME = 'Help Desk'
and t.CREATED >= DATE_ADD(NOW(), INTERVAL -3 month)
Comments:
-
Aragorn - Thanks for you response. I will make the change to the interval to -24 months to gather enough historical data. This is what I have been working on as well:
Select * from HD_TICKET
where HD_QUEUE_ID = 1 and
time(MODIFIED) >= ('15:00:00')
order by created desc;
I want to incorporate a count by month into my query. Currently, I can export the query into Excel and calculate these totals but sure would like to have it all done by the query if possible. Any further suggestions? - holl4one 9 years ago