Page 1 of 1

Report query

Posted: 23 May 2011, 14:52
by sgaucho
Hello,

I need to generate a date wise specific report where I can show the date in one column and the number of defects for each status for a given project.

Does anybody have a query available to obtain this data? I am analyzing the schema but its not very easy!

Mantis version: 1.1.8

Tx,
sg

Re: Report query

Posted: 23 May 2011, 15:02
by Lapinkiller
Hello

this is a sql query for the 1.2.5 database schema :

Code: Select all

SELECT date_submitted,
STATUS , Count( * )
FROM mantis_bug_table
WHERE project_id=1
GROUP BY `status` , `date_submitted`
ORDER BY Count( * ) DESC
i hope it will help you.

Re: Report query

Posted: 24 May 2011, 07:36
by cas
would use something like this, to get the date readable:
SELECT DATE_FORMAT(date_submitted, '%D %M %Y') AS submitted,
STATUS , Count( * )
FROM mantis_bug_table
WHERE project_id=1
GROUP BY `status` , `submitted`
ORDER BY Count( * ) DESC