Sort tasks by due date

I am trying to sort my task based on the due date of each task. What I expected to have is a list of task sort by due. Tasks without due will be listed under tasks that have due

Things I have tried

I have read the document, but I still haven’t known how to implement this feature. I have tried:

task from "Projects" 
where !checked 
group by path 
sort desc

but it didn’t work as I expected

What I’m trying to do

I am trying to get the due date of a single tasks for sorting, but it seems doesn’t work

two questions:

  • if you want to sort by due date, why you use sort desc?
  • since the moment you group tasks by path, how you want to sort the tasks? sorted by due date inside each group? or a global sort? if a global sort you can’t use the groups!
1 Like

Answering the first question, I have tasks locate in different folders and to have different due date, so I want to gather them in one place.

With the second question, I would like to sort them globally.

I found a way to implement this by the following code

task from "Projects" 
where !checked and due
group by due
sort due asc

With tasks that have no due date, I have another script for them.

task from "Projects" 
where !checked and !due
group by due
sort due asc

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.