Of course, you could omit the db.issues.date_today <= request.now if you
know for a fact there are no time travelers opening tickets in the future.
;)
On Monday, April 8, 2013 6:27:18 AM UTC-7, Niphlod wrote:
>
> from datetime import timedelta
> now = request.now
> six_days_back = now - timedelta(days=6)
> db(
> (db.issues.date_today >= six_days_back) &
> (db.issues.date_today <= request.now)
> ).select(whateverfieldyouneed)
>
>
>
> On Monday, April 8, 2013 3:07:57 PM UTC+2, Rahul wrote:
>>
>> Hi All,
>> I am working on a query in SQLite - Where I can search on some data
>> for last 7 days -
>>
>> SQLite raw sql query is as follows:
>> query = db.executesql("SELECT ticket_no, description FROM issues where
>> date_today between datetime ('now', '-6 days') AND datetime ('now',
>> 'localtime')")
>>
>> I need to know the equivalent DAL version of it. Any help would be much
>> appreciated.
>>
>> Rahul
>>
>
--
---
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/groups/opt_out.