notice you can also do:

post_date=db.posts.posted_date.year()|db.posts.posted_date.month()|
db.posts.posted_date.day()

set = db(db.posts.id).select(db.posts.posted_date,
count,groupby=pos_date)

in case you need it in more than once place.

On May 30, 6:38 pm, Neodudeman <[email protected]> wrote:
> Awesome. Exactly what I needed, thank you.
>
> On May 29, 4:14 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > set = db(db.posts.id).select(db.posts.posted_date, count,
> > groupby=db.posts.posted_date.year()|db.posts.posted_date.month()|
> > db.posts.posted_date.day())
>
> > On May 29, 2:42 pm, Neodudeman <[email protected]> wrote:
>
> > > Hi web2py; I've got some problems.
> > > I'm attempting to get a count of some rows based on thedate; but when
> > > I attempt the grouping, it includes thetimeas well, giving me a
> > > false count. (Since no two rows were created at the exact same second,
> > > the count never goes above 1 per 'date')
>
> > > Here's my current code:
>
> > > count = db.posts.id.count()
> > > set = db(db.posts.id).select(db.posts.posted_date, count,
> > > groupby=db.posts.posted_date)
>
> > > How can I change the groupby toignorethetimeportion of the
> > > posted_date?

Reply via email to