Below is a query that works.  It does a sum and groups by date.

db().select(db.test.date,db.test.url,db.test.hits.sum(),groupby=
(db.test.date))

Here is a query that does not work.  I just added an additional
groupby.


db().select(db.test.date,db.test.url,db.test.hits.sum(),groupby=
(db.test.date,db.test.url))

I get this error...

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/dutch/workspace/test/gluon/sql.py", line 2144, in select
    query = self._select(*fields, **attributes)
  File "/home/dutch/workspace/test/gluon/sql.py", line 2087, in
_select
    sql_o += ' GROUP BY %s' % attributes['groupby']
TypeError: not all arguments converted during string formatting


So...why does this happen?  I would have no problem writing this in
SQL.  Tried to view the SQL using _select but got the same error.



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

Reply via email to