Using Sqlite3 and Python, I want to able to get data between two dates with the dates as a variable. For example
date1 = 2020-10-16
date2 = 2020-10-18
"SELECT SUM (total) FROM table WHERE date BETWEEN '%"+date1+"%' AND '%"+date2+"%'"
How can I have BETWEEN grab the date in the variables. When I run this and print the query, the sum is 0 even though I place values inside the rows in (total)