> sorry, it looks like the OP did want people born on the current
month/day/year combo.
No, you were right the first time : ) ... he wanted members whose
dateofbirth, *after changing the year to the current year*, would be today.
That amounts to equating the month and day only.
Something like this would do that:
from sqlalchemy.sql.expression import extract
members_with_birthday_today = Member.query.filter(
(extract("MONTH", Member.dateofbirth) == today.month)
& (extract("DAY", Member.dateofbirth) == today.day))
).all()
Gulli
On Wed, Aug 28, 2013 at 6:01 PM, Jonathan Vanasco <[email protected]>wrote:
> sorry, it looks like the OP did want people born on the current
> month/day/year combo.
>
> you should be able to wrap all the comparisons in a date like this :
>
> Member.query.filter( sqlalchemy.func.date(Member.**dateofbirth) ==
> '2013-08-27' ).all()
> Member.query.filter( sqlalchemy.func.date(Member.**dateofbirth) ==
> sqlalchemy.func.date(datetime.today()) ).all()
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.