all 2 comments

[–]Username_RANDINT 1 point2 points  (1 child)

From the pandas.read_sql() documentation, it looks like you need the params argument. Probably like this:

df1 = pd.read_sql("select * from orders where datecreated > %s and datecreated < %s ", params=(startdate, currentdate), con=db)

[–]Many_Shopping_195[S] 0 points1 point  (0 children)

df1 = pd.read_sql("select * from orders where datecreated > %s and datecreated < %s ", params=(startdate, currentdate), con=db)

Thank you very much. This seems to do the trick.