PDA

View Full Version : Custom Report


zephquamy
02-05-2008, 06:20 PM
I'm trying to write a MySQL query that will give me the total number of messages sent each day not including worker replies.
This report is built into Cerberus, but doesn't allow me to specify absolute date ranges.
I've got a good start on it, but I'm missing something as the total my query returns is about 1000 higher than the internal Cerberus query. What am I missing?


select date(from_unixtime(created_date)) as thedate, count(*) as ticketcount
from message as m
where from_unixtime(created_date) between '2008-1-1' and '2008/2/1' and is_outgoing = 0
group by thedate

Hildy
02-05-2008, 08:42 PM
This report is built into Cerberus, but doesn't allow me to specify absolute date ranges.
What report are you referring to? The New Tickets report only counts tickets, not individual messages on those tickets, if that's the one you're referring to. Take a look at the getNewTicketsReportAction() function in cerb4/plugins/cerberusweb.reports/api/App.php to see the sql that we're using to pull that data.