Thanks Kenneth;

I actually did it this way also but I thought there would be a more elegant way to achieve it.

Although I guess not.

Sometimes since DAL does so much for in simple ways; I thought perhaps there was a simple way of doing this as well


On 6/27/11 6:54 AM, Kenneth Lundström wrote:
> How do I use DAL to query by exact date?

db((db.events.created_on < datetime(date_of_day+1 0.00.00)&(db.events.created_on > datetime(date_of_day 0.00.00)).select()

Or then you need to save even just the date of the event, not datetime as created_on saves.

I might be totally wrong but this should work.


Kenneth


I tried

db(db.events.created_on == request.now.date).select()

but this returned no rows?

I also tried

db(db.events.created_on.date == request.now.date).select()

but that throws an exception

Thanks.




Reply via email to