[web2py] REF: Finding if a date is between two date fields

2014-02-05 Thread Teddy Nyambe
I would like to find out how to achieve this comparison: row = db(db.mytable.start_date < today < db.mytable.end_date).select() I am getting this error: Traceback (most recent call last): File "/Users/teddyl/PycharmProjects/website/web2py/gluon/contrib/shell.py", line 234, in run exec comp

Re: [web2py] REF: Finding if a date is between two date fields

2014-02-05 Thread Johann Spies
Try query = db.mytable.start_date < today & db.mytable.end_date > today row = db(query).select() This works for me: surveylist = [(x.id, x.name) for x in db( (db.survey.startdate <= today)& (db.survey.enddate >= today)).select(db.survey.id,