/build/static/layout/Breadcrumb_cap_w.png

I need help creating a report that just shows the Owner and how many tickets they closed the past 7 days.

I did find exactly what i am looking for on the forum except i dont know how to add just show the tickets the past 7 days and not lifetime. Here is what i have right now (THANKS TO AIRWOLF)

 

SELECT IFNULL(O.FULL_NAME,'Unassigned') AS 'Owner', COUNT(T.ID) AS '# of Tickets' FROM HD_TICKET T JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID) LEFT JOIN USER O ON (T.OWNER_ID = O.ID) GROUP BY O.FULL_NAME


0 Comments   [ + ] Show comments

Answers (4)

Posted by: nshah 11 years ago
Red Belt
3

The report already in the KBOX named "Closed Tickets last 7 days by Owner

" won't work for you? It is under the Helpdesk category.

Posted by: RandomITPro 11 years ago
4th Degree Black Belt
3

jbigman3122,

You can either, duplicate the report and trim out the info you don't need if you will continue to need the report. or if this is kinda a one time thing, you can export the report to csv and delete the irrevelant information. I do both depending on the situation

Posted by: jbigman3122 11 years ago
Senior Yellow Belt
0

I was trying to get it without all the other stuff. The boss just wants to see how many tickets were closed. That report show everything about the ticket.

Posted by: jverbosk 11 years ago
Red Belt
0

To remove columns that you don't need/want, you can just remove them from the SELECT statement at the very beginning of a query.

For other tips on writing/modifying MySQL queries for the K1000, please see the following post:

http://www.itninja.com/blog/view/primer-for-writing-select-statement-queries-on-the-k1000-w-custom-sql-report-example

As for the report you want, try this out.  You can add columns to your liking, just be aware that if you need to add columns that aren't present in the table referenced in the FROM statement, you'll need to use a JOIN statement (or statements) to add the column(s) you want to display.

Hope that helps!

John

_______________________________

SELECT IFNULL(O.FULL_NAME,'Unassigned') AS 'Owner', COUNT(T.ID) AS '# of Tickets'

FROM HD_TICKET T

JOIN HD_STATUS S ON (T.HD_STATUS_ID = S.ID)

LEFT JOIN USER O ON (T.OWNER_ID = O.ID)

WHERE S.NAME = 'closed' AND DATEDIFF(NOW(),T.TIME_CLOSED) < 7

GROUP BY O.FULL_NAME

ORDER BY O.FULL_NAME

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ