for information, I use sqlite3 for database and the field for date_correction is 'TEXT'
I modified the function designated to display the selection by dates as follows:
but nothing happen except dispaly error
I modified the function designated to display the selection by dates as follows:
def select_by_dates (self): start_date =self.lineEdit_start_date.text() end_date = self.lineEdit_end_date.text() try : conn = sqlite3.connect ('correction.db') curseur=conn.cursor() c=curseur.execute("SELECT * FROM correction_loc35R WHERE date_correction BETWEEN start_date.strftime('%Y-%m-%d') AND end_date.strftime('%Y-%m-%d') ") liste_select_by_dates_correction=c.fetchall() nbr_rows=len(liste_select_by_dates_correction) if nbr_rows != 0 : # set row count self.tableWidget_select_by_dates_correction.setRowCount(nbr_rows) for nb in range(nbr_rows): for nombre in range(10): self.tableWidget_select_by_dates_correction.setItem(nb,nombre, QTableWidgetItem(liste_select_by_dates_correction[nb][nombre])) self.tableWidget_select_by_dates_correction.resizeRowsToContents() self.tableWidget_select_by_dates_correction.resizeColumnsToContents() conn.commit() curseur.close() conn.close() else : print("OK") except : print("error")
but nothing happen except dispaly error