Well it seems that some of your indentation is off but I think that I can adjust for that. Further assuming all that other disconnected stuff (first 3 functions/methods is working correctly. Here is all I think you need to adjust to make it work -- which is what I have been trying to get you to understand all along. Basically what you were doing was not passing in the variables' contents but a string of the variable name
conn = sqlite3.connect ('correction.db') curseur=conn.cursor() strSQL = '' strSQL += "SELECT * " strSQL += "FROM correction_loc35R " strSQL += "WHERE date_correction " strSQL += "BETWEEN " + start_date.strftime('%Y-%m-%d') strSQL += "AND " + end_date.strftime('%Y-%m-%d') c=curseur.execute(strSQL)Lastly let me state that you ought to have put your database interactions within a self-contained and autonomous Class where you simple call the API methods instead of what it appears you have perhaps done. What you have appears far more complex than it needs to be. Keep in mind if you keep it simple and smart it is far much easier to deal with now and later on.