Felix Collins wrote:
Thanks for the try Matt. I tried it and it didn't work. As you probably
noticed from the other query, I'm a bit of an SQL newb, so I couldn't
spot what was wrong with your query.
Maybe I'm not such a Newb. I just spent 2 minutes debugging it and now
it works! Thanks for your help.
SELECT t.owner AS Developer,
SUM(CASE WHEN currest.value not in ('', '0') THEN currest.value
WHEN estimate.value not in ('', '0') THEN estimate.value
ELSE 0 END)
AS Estimate_On_Remaining_Tickets,
SUM(cumul.value) AS Cumulative_Time_On_Remaining_Tickets
FROM ticket AS t
LEFT JOIN ticket_custom AS estimate on estimate.ticket = t.id
and estimate.name = 'estimatedtimehours'
LEFT JOIN ticket_custom AS currest on currest.ticket = t.id
and currest.name = 'currentestimatehours'
LEFT JOIN ticket_custom AS cumul on cumul.ticket = t.id
and cumul.name = 'cumulativehours'
WHERE t.status IN ('new', 'assigned', 'reopened')
GROUP BY Developer
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac