Re: [web2py] DAL and date calculations

2012-01-28 Thread Bruce Wade
today = datetime.date.today() yesterday = today - datetime.timedelta(1) today_ads = self.db(db.table.date > yesterday).select().first() On Sat, Jan 28, 2012 at 6:35 AM, Ed Greenberg wrote: > Using the DAL, I'd like to select records that are less than some > interval old, or newer than a certain

[web2py] DAL and date calculations

2012-01-28 Thread Ed Greenberg
Using the DAL, I'd like to select records that are less than some interval old, or newer than a certain date. My records have a datetime field in them. So I want something like: select * from table where mydate > (now()-interval 1 day) Can I do this in the dal, or do I have to use raw sql? Tha