diff --git a/apps/schedulers/tasks.py b/apps/schedulers/tasks.py index fb18663..a4022c0 100644 --- a/apps/schedulers/tasks.py +++ b/apps/schedulers/tasks.py @@ -477,7 +477,7 @@ def load_sotekom(): cursor_device_model = cursor.fetchall() for device_model in cursor_device_model: element.model = device_type[1] - SQL_QUERY = r'SELECT * FROM vw_WDATA_POSITION WHERE Machine = ' + "'" + str(data[1]) + "' ORDER BY AtTime DESC LIMIT 1" + SQL_QUERY = r'SELECT * FROM vw_WDATA_POSITION WHERE Machine = ' + "'" + str(data[1]) + "' ORDER BY AtTime DESC TOP 1" cursor = mssql.executeSQL(conn,SQL_QUERY) cursor_position = cursor.fetchall() for position in cursor_position: