Re: [SQLObject] Distinct value lookup on DateTimeCol()
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: F.A. P. <f_...@ly...> - 2007-06-18 16:09:50
|
Hi Jaime, Jaime Wyant wrote: > If you just want to select on a date using datetime, something like the > code below ought to work. Can anyone explain how you could query based > on a specific year? For instance, how would you select all birthdays > where year is 1974? > From an earlier discussion I copied this and modified it a little: events = Event.select ( AND ( Event.q.date >= datetime ( yearstart, monthstart, daystart), Event.q.date <= datetime ( yearend, monthend,dayend) ) ) In your case you have to substitute 1974 for yearstart 1 for monthstart 1 for daystart 1974 for yearend 12 for monthend 31 for dayend This is untested because my little app is recovering form a 'transplant' :-) Frans. |