Okay so to start with, I sorted the dt using a modified SQL query "SELECT * FROM Tasks WHERE IsActive = 1 ORDER BY ECompletion ASC". This gives me all active tasks ordered by earliest date.