Thank you Denes, What I'm trying to do is to select the date part from a datetime as specified in the email subject, so the AcctStartTime field is a datetime.
I'm navigating the epydoc documentation for dal.Field http://www.web2py.com/examples/static/epydoc/web2py.gluon.dal.Field-class.html and I cannot find reference for the date() method (only year(),month(), day(), hour(), minutes(), seconds()) . Perhaps the documentation is out of date. I made several tries and in one of this I tryed also the date() method in a query something like this: rows = dbradius(dbradius.radacct.CalledStationId==hsname).select( count, dbradius.radacct.AcctStartTime.date(), groupby=entry_date) and it throws an exception. I can really make a mistake, so I'll try your suggestion as soon as possible! Thank you. 2011/7/12 DenesL <denes1...@yahoo.ca>: > Hi Angelo, > > it depends on the type of field, > > date fields can be accessed directly, > e.g. dbradius.radacct.AcctStartTime > > datetime fields need .date(): > dbradius.radacct.AcctStartTime.date() > > Denes. > > On Jul 12, 1:58 pm, Angelo Compagnucci <angelo.compagnu...@gmail.com> > wrote: >> Ello everybody! >> >> I'm stuck whith a really simple thing, but the simpler are the worst! >> >> I wrote this query: >> >> rows = dbradius(dbradius.radacct.CalledStationId==hsname).select( >> count, >> dbradius.radacct.AcctStartTime.year(), >> dbradius.radacct.AcctStartTime.month(), >> dbradius.radacct.AcctStartTime.day(), >> groupby=entry_date) >> >> Query works well, but I want a signle field for the date part, not the >> three fields (year, month, day) I obtain. >> >> There is a simple way to accomplish this? >> >> Thank you!