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 <greenberg...@gmail.com>wrote: > 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? > > Thanks, > > Ed > -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com