I have this in my notes:
- #inbox
- TODO Task A: Include this task SCHEDULED: <2024-06-28 Fri>
- TODO Task B: Don't include this task
- TODO Task C: include this task #inbox SCHEDULED: <2024-06-29 Fri>
How can I write an advanced query that:
- only retrieves tasks under the
#inbox
tag - only returns tasks that have been scheduled?
I tried:
#+BEGIN_QUERY
{ :query [:find (pull ?b [* {:block/_parent ...}])
:in $ ?date ?tag
:where [?b :block/scheduled ?day]
[?p :block/name ?tag]
[?b :block/refs ?p]
[?b :block/marker ?marker]
[(contains? #{"TODO"} ?marker)]]
:inputs [:today "inbox"]
}
#+END_QUERY
But that doens’t work: the SCHEDULED
is a part of the TODO
block, while the #inbox
is in its ancestor. The query above looks for both these attributes to belong to the same block, which is not what we want.
Thank you!