Author: Jon Roberts Date Created: 2008-02-01 I thought it would be useful to have an example of using a date field in custom reports. This is for the following configuration in trac.ini: [ticket-custom] due_date = text due_date.date = true due_date.date_empty = true due_date.label = Date Due (mm-dd-yyyy) [datefield] format = mdy separator = / Here is the report SQL: SELECT p.value AS __color__, id AS ticket, summary, owner, c.value AS due_date FROM ticket t, enum p, ticket_custom c WHERE t.id = c.ticket AND c.name = 'due_date' AND p.name = t.priority AND p.type = 'priority' ORDER BY date(substr(c.value,7,4)||"-"||substr(c.value,1,2)||"-"||substr(c.value,4,2)),p.value