SELECT t.owner AS Developer,
   SUM(CASE WHEN currest.value not in ('', '0') THEN currest
            WHEN est.value not in ('', '0') THEN est END)
       AS Estimate_On_Remaining_Tickets,
   SUM(cumul.value) AS Cumulative_Time_On_Remaining_Tickets
   FROM ticket AS t
   LEFT JOIN ticket_custom est on estimate.ticket = t.id
      and name = 'estimatehours'
   LEFT JOIN ticket_custom currest currest.ticket = t.id
      and name = 'currentestimatehours'
   LEFT JOIN ticket_custom cumul on cumul.ticket_custom = t.id
      and name = 'cumulativehours'
   WHERE t.status IN ('new', 'assigned', 'reopened')
   GROUP BY Developer


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.

Regards,
Felix
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

Reply via email to