Re: Selecting date formats for aggregate calculations from database with Django

2009-04-09 Thread Russell Keith-Magee
On Fri, Apr 10, 2009 at 5:23 AM, Andrew C wrote: > > I would like to do aggregate calculations based on month for a > datetime field. This feature request has been made before; it's logged as ticket #10302. > I am currently using the extra() function to format the date

Selecting date formats for aggregate calculations from database with Django

2009-04-09 Thread Andrew C
I would like to do aggregate calculations based on month for a datetime field. I am currently using the extra() function to format the date like: ...extra(select="strftime('column', '%m/%Y') as t").values ('t').annotate(SUM(foo)) and it works great for sqlite3. In sqlite3 I can use