SQLite - SELECT TOP syntax error [duplicate]

Use LIMIT 1 at the end of the query instead of TOP 1 (which isn't valid sqlite syntax).

You might also need to remove the ? in dueDate < ?1, but I don't know sqlite well enough to be sure.