diff --git a/insertLoading.py b/insertLoading.py index 6967b03..cfa3d7f 100644 --- a/insertLoading.py +++ b/insertLoading.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- from datetime import datetime, timedelta +import sys import sqlite3 @@ -14,6 +15,7 @@ try: watt = sys.argv[2] except: print("Fehlende Command Line Inputs") + exit(0) ## @@ -40,7 +42,7 @@ def updateLast(cursor): ## hole letztes Ladungs-Datum sql = ''' - SELECT id, l_date FROM bike_loading ORDER BY d_date DESC LIMIT 1; + SELECT id, l_date FROM bike_loading ORDER BY l_date DESC LIMIT 1; ''' cursor.execute(sql) row = cursor.fetchone()