Looking for open TODOs is a thing I have not yet been able to integrate.
Looing for page name AND tag works in most cases. Sometimes it shows blocks which seem to have nothing to do with the query resp. do not contain either page name or tag.
I’d be grateful for any hints how I could do this.
#+BEGIN_QUERY
{:title [:h3 "Find TODOs with '@mn' AND '#talk'" ]
:query [:find (pull ?b [*])
:where
[?p :block/name "@mn"] ; name is always lowercase
[?b :block/refs ?p] ; this block references ?p as oppose to being on ?p through :block/page.
[?b :block/marker "TODO"]
[?t :block/name "talk"] ; where/how to I use the "(and ...)"
]
}
#+END_QUERY
This works but does not link the 3 criteria via AND so some TODOs contain “talk” others only “mn” not.
And is always used between statements.
However your query does not link ?b and ?t currently.
So you will need a [?b :block/refs ?t] statement after [?t :block/name "talk"].