I have two queries that show me all the DONE todo blocks that are either on the current page (today’s journal date) or that reference today’s journal date)
#+BEGIN_QUERY
{
:title [:h3 “DONE”]
:query [:find (pull ?b [*])
:in $ ?current ?day ?next
:where
[?p :block/name ?current]
[?b :block/refs ?p]
[?b :block/page ?page]
[?b :block/marker “DONE”]
]
:inputs [:current-page :today :+1d]
:breadcrumb-show? false
:group-by-page? false
}
#+END_QUERY
#+BEGIN_QUERY
{:title [:h3 “ALSO DONE”]
:query [:find (pull ?b [*])
:in $ ?current ?day ?next
:where
[?b :block/page ?p]
[?b :block/marker “DONE”]
(between ?b ?day ?next)
]
:inputs [:current-page :today :+1d]
:breadcrumb-show? false
:group-by-page? false
}
#+END_QUERY
Both of these work but I would rather it all be one Advanced Query that asks is it on the current page or does it reference the current day. All my attempts to use OR logic for [?p :block/name ?current] or (between ?b ?day ?next) don’t work because I can’t have OR logic that mixes mix ?p and ?b.
Anyway to merge these into one clean Advanced Query?