Skip to main content

Number of tickets created by month - DPQL Reports - Deskpro Support

The query below creates a count of tickets created by month and year:

 

SELECT DPQL_COUNT() AS 'Tickets Created'

FROM tickets

GROUP BY DPQL_ALIAS(DATE_FORMAT(tickets.date_created, '%Y-%M'), 'Date Created')

ORDER BY tickets.date_created

   

Note we're using  DATE_FORMAT to format the date the ticket was created so the count is per month. *

 We're also using  DPQL_ALIAS  to format the title of the group by column to 'Date Created': 

*  You  can format the date using standard MYSQL specifiers. There's a useful list of options from the mysqltutorial.org site below:      

 http://www.mysqltutorial.org/mysql-date_format/ 

 


 


 



Add a comment

Please log in or register to submit a comment.

Need a password reminder?