[Trac] date functions in report queries

Sam Keen sam.sjk at gmail.com
Wed Jul 5 17:27:34 CDT 2006


I was wanting to make some custom queries such as 'modified in last five days'

so far I have...

SELECT
id AS ticket, changetime AS modified, component, status, severity,
priority, owner, time as created, summary
FROM ticket
ORDER BY modified DESC

but I would like something to the effect of...

SELECT
id AS ticket, changetime AS modified, component, status, severity,
priority, owner, time as created, summary
FROM ticket
WHERE modified > [five days ago]
ORDER BY modified DESC

Are there date functions that can be used directly in the SQL or some
other technique to accomplish this.

Thanks in advance,

Cheers,
Sam


More information about the Trac mailing list