Trying to have Python SQL statement use current date instead of manually updating the string with a fixed date. I used few examples that I commented out below that did not work. Is this possible to have current date in Python sql statement?
#Pull data from exat SQL Server into dataframe
with sscon.exat_connection() as conn:
fields = "app.RecordID, app.IproAppealID, app.Received, app.CaseDue, pla.CompanyName, appi.AppealerAddress1,app.EnteredBy"
table = "dbo.tblAppealInformation app LEFT OUTER JOIN dbo.tblPlanInformation pla ON (app.PlanID = pla.PlanID) LEFT OUTER JOIN dbo.tblAppealerInformation appi ON (app.AppealerID = appi.AppealerID)"
conditions = "app.Received > '2022-06-14' AND app.ClientID = 117" #yyyy-mm-dd
#conditions = "app.Received > {datetime.datetime.now():%Y-%m-%d%H:%M:%S} AND app.ClientID = 117" #yyyy-mm-dd
#conditions = "app.Received > {now:%Y-%m-%d%H:%M:%S} AND app.ClientID = 117" #yyyy-mm-dd
order = "3"
sql = (f"SELECT {fields} "
f"FROM {table} "
f"WHERE {conditions} "
f"ORDER BY {order}")
# print(sql)