On Sat, Aug 8, 2009 at 6:12 PM, tm<tmugav...@gmail.com> wrote:
>
> Hello,
>
> I have been trying all sorts of things with aggregate and annotate and
> can't seem to get the right combination.  Is there a way to get the
> sum of one or multiple columns for each day?  Similar to:
>
> SELECT view_date, SUM(my_column) FROM my_table GROUP BY DAY
> (view_date);
>
> This works in raw sql, I just can't figure out the right way in
> Django.  Any help would be greatly appreciated.
>
> Thanks,
>
> T
> >
>

Right now Django's aggregation functions don't provide a way to work
with dates that easily, however I think this task might be
accomplishable with a custom Aggregate object, search the mailng list
for more information on creating these.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to