Change to task and sql query