I now it  was posted a long time ago, but there are a simpler solution:

dt = request.now.date()

rows = db( 
    (db.events.created_on.date()==dt) 
).select()


Em sábado, 16 de julho de 2011 09:25:57 UTC-3, AngeloC escreveu:
>
> > that "dirty hack" fails for the MSSQL adapter in 1.97.1:
>
> Well yes, I called it a dirty hack!
>
> I'm looking for a function to extract date and time from a datetime db
> side and I think I found one for every database supported by the DAL,
> I'm in the process of review my research.
>
> I'm intrugued in the process to add new date() and time() functions to
> Filed class.
>
> >>>> rr=db(db.test).select(db.test.data)
> >>>> print rr[0]
> > <Row {'data': datetime.datetime(2011, 7, 15, 14, 34, 18)}>
> >
> >>>> rr=db(db.test).select(db.test.data[:10])
> >>>> print rr[0]
> > <Row {'_extra': <Row {'SUBSTR(test.data,1,(11 - 1))': u'2011-07-15'}>}
>
> Yes, I noticed that, a substring command returns a string, and not a
> date object ... But for me it will suffice.
>
> Thank you!
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to