TLDR;
* except (@done///* union ((@start < [d] today + 24h) union (@start < [d] today + 24h)/..*))
There is a way. It is kind of complicated. I think I have a post or two on the method to my madness. I think that these are posts. Only read them after understanding this post.
Looking for notes with no children.
Unexpected Query
Question about paths
Here is what I would do. If you have no interest on the process, just read the TLDR and get the query. I am placing this here for those who might later have a similar question.
-
Create a new document with the example you posted above. Maybe make it a little bit more complicated just to make things more interesting and understand what is going on
-
Now you would like to get the opposite. You want to get the tasks that have children with certain date.
Here is where the “Axes” section in the documentation come into place. Read them, I know that you will not “understand” them completely, but it might help. Start with what you already wrote, but you need to remember that in order to have TaskPaper compare something as a date instead of as a text, you need to add the modifier [d]
.
(@start < [d] today + 24h)
Now, you can see that you are seeing the “parent” because you are looking at the “children”, but since what you want to eliminate from your query is the “parent” that has a “particular child”, then just do something like this.
(@start < [d] today + 24h)/..*
Now that you have exactly what you don’t want, you can work backward.
- Build your query.
There is a different between “or” and “union”. In this case, “union” is what you want to do. The same applies to “not” and “except”. This is already too much for some people, but I if you need to understand this, I would again refer you to the documentation. Anyhow, your next step is making the query.
A. Since we are starting with “except”, you also need a “*”. Something like,
* except ...
B. Next, since you don’t tasks that are done (I would recommend using the ///*
at the end of the tag instead of //
at the beginning of it. There are some other posts that explain that), add that to the query
* except @done///*
C. Then add the dates you don’t want to see. In your example it would be something like,
* except (@done///* union (@start < [d] today + 24h))
D. Finally, I would add the parent(s) of the tasks with your date.
* except (@done///* union ((@start < [d] today + 24h) union (@start < [d] today + 24h)/..*))
This will automatically hide the parents that ONLY have tasks with your (@start < [d] today + 24h)
. This is because of how the search engine works. Hope that this helps.