def list_by_date(cursor, fromDate, toDate):
try:
- result=cursor.execute("SELECT * FROM vaccination LEFT JOIN inventory ON vaccination.iid=inventory.iid LEFT JOIN patients ON vaccination.pid=patients.pid WHERE date BETWEEN ? AND ? ORDER BY vaccination.iid", (fromDate, toDate))
+ result=cursor.execute("SELECT * FROM vaccination LEFT JOIN inventory ON vaccination.iid=inventory.iid LEFT JOIN patients ON vaccination.pid=patients.pid WHERE vaccination.date BETWEEN ? AND ? ORDER BY vaccination.date, vaccination.iid", (fromDate, toDate))
if(cursor.rowcount==0):
return (False, "Record not found.")
else: