Put this in a little MUC (Minimal Usable Code) and run it and then you tell me why the 2nd one does not work ;-)
start_date ='01-12-2019' end_date = '28-12-2019' MySQL_1 = "SELECT * FROM correction_loc35R where date_correction between '01-12-2019' AND '28-12-2019' ORDER BY date_correction DESC" MySQL_2 = "SELECT * FROM correction_loc35R where date_correction between start_date AND end_date ORDER BY date_correction DESC" print(MySQL_1) print(MySQL_2)