You are ordering by *milestone* filed in *ticket* database, which is a
text field - the name of the milestone.
Details about each milestone are tracked in the *milestone* table, so
you have to join that table in your query, if you want due date.
Here's my report for active tickets per milestone:
SELECT p.value AS __color__,
(CASE t.milestone WHEN NULL THEN 'Unclassiffied'
WHEN '' THEN 'Without a Milestone'
ELSE concat(milestone, ' Release, due
',from_unixtime(m.due)) END) AS __group__,
t.id AS ticket, t.summary, t.component, t.version as
_version, t.type AS type, priority,
(CASE t.status WHEN 'assigned' THEN concat(owner, ' *') ELSE
owner END) AS owner,
t.time AS created,
t.changetime AS modified,
t.description AS _description,
t.reporter AS _reporter
FROM ticket t
LEFT OUTER JOIN enum p ON p.name = t.priority AND p.type =
'priority'
LEFT OUTER JOIN milestone m on t.milestone=m.name
WHERE status IN ('new', 'assigned', 'reopened')
ORDER BY (t.milestone IS NULL),m.due, p.value, t.type, time
On Mar 2, 2:47 pm, bbew <[email protected]> wrote:
> I have been banging on this report trying to get it to get it to order
> by milestone due date. Any help would be appreciated!
>
> SELECT p.value AS __color__,
> milestone||' Release' AS __group__,
> id AS ticket, summary, priority, owner, component, reporter, t.type
> AS type,
> time AS created,
> changetime AS _changetime, description AS _description,
> reporter AS _reporter
>
> FROM ticket t, enum p
> WHERE status <> 'closed' AND milestone <> ''AND p.name = t.priority
> AND p.type = 'priority'
> ORDER BYmilestone, p.value, severity, time
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.