This would give you all closed tickets in the last 1 month:
____________________________________________
SELECT DISTINCT
id AS ticket, time, owner, version, milestone, resolution, status
FROM ticket t
WHERE status IN ('closed')
AND time >= (select strftime ("%s", "now", "-1 month"))
ORDER BY time
____________________________________________
or if you wanted all in the current calendar month you could change
the select
line to:
AND time >= (select strftime ("%s", "now", "start of month"))
Another report I have is for selecting defects and enhancement tickets
which
were closed between two dates:
___________________________________________
select id, type, summary, component, milestone, owner,
datetime((select max(tc.time) from ticket_change tc
where
t.id = tc.ticket and field = 'status' and newvalue =
'closed'),
'unixepoch', 'localtime') as closedate,
(select max(tc.time) from ticket_change tc
where
t.id = tc.ticket and field = 'status' and newvalue =
'closed')
as closetime
from ticket t
where status = 'closed'
and closetime > strftime('%s',datetime('2006-03-24 16:38:45')) +0
and closetime < strftime('%s',datetime('2006-04-06 15:25:34')) +0
AND type IN ('defect','enhancement')
order by -closetime;
___________________________________________