As answered by other members above,
ORDER BY and
LIMIT keywords are
not supported in SQLite by default when doing an UPDATE.
The workaround is posted by
@LucaMs but as my reply on post #15, the row to be updated would not be the last row.
If the table has a primary key as my example code above, we can use MAX(rowid) to get the last row.
SQL1.ExecNonQuery2("UPDATE tblClientGivenMedicine_Temp SET Notes = ? WHERE rowid = (SELECT MAX(rowid) FROM tblClientGivenMedicine_Temp WHERE JobDate = ? AND DrugID = ?)", Array As Object("555", "12/20/2025", 11197))
So instead of rowid = 4 is updated, rowid = 6 is the one getting updated.