From: Agnibho Mondal Date: Thu, 11 Jan 2024 20:06:01 +0000 (+0530) Subject: Sort report by inventory X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=2c703340003a010e25a79589bf5e3cea55844482;p=librevax.git Sort report by inventory --- diff --git a/vaccination.py b/vaccination.py index ec3a17e..68ed6ed 100644 --- a/vaccination.py +++ b/vaccination.py @@ -67,7 +67,7 @@ def list_by_inventory(cursor, iid): def list_by_date(cursor, date): 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 LIKE ?", (date+"%",)) + result=cursor.execute("SELECT * FROM vaccination LEFT JOIN inventory ON vaccination.iid=inventory.iid LEFT JOIN patients ON vaccination.pid=patients.pid WHERE date LIKE ? ORDER BY vaccination.iid", (date+"%",)) if(cursor.rowcount==0): return (False, "Record not found.") else: