Advanced query to find all pages with property storing journal page reference in the past

this query works - not sure it’s the best format

#+BEGIN_QUERY
{:title [“:bullseye: Related projects”] :inputs [:today]
:query [:find (pull ?p [*])
:in $ ?today
:where [?p :block/tags ?t][?t :block/name “.project”]
[?b :block/page ?p][?p :block/properties ?prop] [(get ?prop ::spiral_calendar:) ?review]
[?j :block/original-name ?journal][(contains? ?review ?journal)]
[?j :block/journal-day ?d][(> ?d ?today)]
] :collapsed? false}
#+END_QUERY

if I reverse the comparison (just in case I was lucky):

#+BEGIN_QUERY
{:title [“:bullseye: Related projects”] :inputs [:today]
:query [:find (pull ?p [*])
:in $ ?today
:where [?p :block/tags ?t][?t :block/name “.project”]
[?b :block/page ?p][?p :block/properties ?prop] [(get ?prop ::spiral_calendar:) ?review]
[?j :block/original-name ?journal][(contains? ?review ?journal)]
[?j :block/journal-day ?d][(< ?d ?today)]
] :collapsed? false}
#+END_QUERY

got the expected result:

thanks to this post: Query page property by date range - #4 by Siferiax :slight_smile: