[Trac] Re: Date Ranged queries

Andy Lubel lubela at tteam.com
Thu Jan 13 10:45:47 EST 2005


Strftime is pretty cool but doesn't seem to want to play nice with me.  Ive
really never worked with that sort of date format.  Can you point me on how
to do the ranged query?  One thing I noticed about the example you provided
is that I better run it before the 1st of the next month, and I risk having
data entered unless I run it at 11:59pm on the 31st.  Its that "start of
month" that is confusing me, although it is kinda cool. Thanks for help.    

select id from ticket where time >= (select strftime ("%s", "now", "start of
month"));

Andy

-----Original Message-----
From: trac-bounces at lists.edgewall.com
[mailto:trac-bounces at lists.edgewall.com] On Behalf Of Justus Pendleton
Sent: Wednesday, January 12, 2005 6:13 PM
To: trac at lists.edgewall.com
Subject: [Trac] Re: Date Ranged queries

Andy Lubel <lubela at ...> writes:
> I see that in the custom report section, there is a nice little report 
> builder where you can select columns, would it be hard to include date 
> ranges in that?  Has it already been done?  I am very new to SQLlite, 
> so I don't know how possible it is.. Can anyone point me in the right
direction?
> Do any of you users out there use this software to cut nasty overhead 
> coming from SW-CMM requirements?

It sounds like what you want is a new report --
http://projects.edgewall.com/trac/wiki/TracReports -- and you can just hand
write the SQL for that.  If you log in with someone who has REPORT_CREATE
privileges you'll see a link in the report section for "New Report".

If you want a list of all files that have changed this month you'd use a SQL
statement like:

select distinct name from node_change where rev in (select rev from revision
where time >= (select strftime ("%s", "now", "start of month")));

A list of new tickets this month would be something like:

select id from ticket where time >= (select strftime ("%s", "now", "start of
month"));



_______________________________________________
Trac mailing list
Trac at lists.edgewall.com
http://lists.edgewall.com/mailman/listinfo/trac




More information about the Trac mailing list