/build/static/layout/Breadcrumb_cap_w.png
I need to prduce a report weekly for "how many calls were logged this week" this can be manually, emailed etc. I just need an overall number
0 Comments   [ + ] Show comments

Comments


All Answers

3
Here is one method that uses the week function:
SELECT YEAR(CREATED) AS Year, WEEK(CREATED) AS Week, 
COUNT(ID) AS "Opened"
FROM ORG1.HD_TICKET
WHERE YEAR(CREATED) = YEAR(NOW())
AND WEEK(CREATED) = WEEK(NOW())
GROUP BY YEAR(CREATED), WEEK(CREATED)
This uses tickets opened in the past seven days:
SELECT COUNT(ID) FROM ORG1.HD_TICKET
WHERE DATE(CREATED) > DATE_SUB(NOW(), INTERVAL 7 DAY)
You can create a report using either one and schedule the report to run as needed.

Answered 07/19/2018 by: chucksteel
Red Belt