I was addicted to creating a conditional statement using date_format in a SQLAlchemy query, so I left a note.
from sqlalchemy import func
User.query.filter(
func.date_format(User.date, "%Y-%m-%d") == day.strftime("%Y-%m-%d")
)
Since func contains count and current_timestamp, I think that there is a high probability that it will be solved if you look at the document if you have a problem.
https://docs.sqlalchemy.org/en/13/core/functions.html
Recommended Posts