trac report to list tickets by milestone with milestones ordered by due date

On my version of trac report 3 was great but ordered milestones alphabetically, rather than by due date.

The following trac sql fixes it:

SELECT p.value AS __color__,

'Milestone '||t.milestone AS __group__,

t.id AS ticket, t.summary, t.component, t.version, t.type AS type,

t.owner, t.status, t.time AS created, t.changetime AS _changetime,

t.description AS _description, t.reporter AS _reporter,

m.due AS _dueDateTime

FROM ticket t, milestone m

LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'

WHERE (status <> 'closed') AND (m.name = t.milestone)

ORDER BY (milestone IS NULL), _dueDateTime, CAST(p.value AS int), t.type, time

Tags: trac