Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

python sqlalcahmey compare datetime using extract

from sqlalchemy import extract

payments = Payment.query.filter(extract('month', Payment.due_date) >= datetime.today().month,
                                extract('year', Payment.due_date) >= datetime.today().year,
                                extract('day', Payment.due_date) >= datetime.today().day).all()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #sqlalcahmey #compare #datetime #extract
ADD COMMENT
Topic
Name
8+6 =