I have a table (called 'entry') which has a datetime column (called 'access_date'), and I want to do an SQLAlchemy query that only produces results where entry.access_date is a Monday (or any other day of the week specified by a number [0..6]).
Is this possible? I am using sqlite & SQLalchemy 0.5.8 if that makes any difference.
Further from Daniel Kluev's answer, I found another way of saying the same thing (possibly nicer looking?)
query.filter(func.strftime('%w', Entry.access_date) == str(weekday)).all()
Where weekday is a number [0..6]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With