ODBC guide

Search tasks (advanced filters)


Search tasks with filters similar to the Asana search UI. You can filter by search text, projects, due date (exact or range), whether the task has an attachment, and date filters such as created or completed. Relative dates (e.g. start of year plus one day, or now minus 10 hours) are supported.

--//search text in task title or description
SELECT * FROM search_tasks WITH(Text='Hotfix')

--//search text in all tasks from any projects listed below
SELECT * FROM search_tasks WITH(Text='Hotfix', ProjectsAny='1200652735638082,1206028542305053')

--//list all tasks from any projects listed below
SELECT * FROM search_tasks WITH(ProjectsAny='1200652735638082,1206028542305053')

--//list all tasks due on specified date (same way you can use CreatedOn, CompletedOn ...) 
SELECT * FROM search_tasks WITH(DueOn='2024-12-21')

--//list all tasks with due date after specified date (same way you can use CreatedOnAfter, CompletedOnAfter ...) 
SELECT * FROM search_tasks WITH(DueOnAfter='2024-12-21')
SELECT * FROM search_tasks WITH(DueOnAfter='yearstart+1d')

--//list all tasks with due date after specified date (same way you can use CreatedOnBefore, CompletedOnBefore ...) 
SELECT * FROM search_tasks WITH(DueOnBefore='2024-12-21')
SELECT * FROM search_tasks WITH(DueOnBefore='monthstart-5d')

--//list all tasks with due date after specified datetime (same way you can use CreatedAtBefore, CompletedAtBefore ...) 
SELECT * FROM search_tasks WITH(DueAtBefore='2024-12-21T23:59:59')
SELECT * FROM search_tasks WITH(DueAtBefore='now-10h')

--//list all tasks with attachment
SELECT * FROM search_tasks WITH(HasAttachment='true')