anneC
October 19, 2025, 1:26pm
1
Hello there,
I aim to review my project pages on regular basis. For that, each of my project has a property “ ” storing a reference to only one journal page. The idea is to identify during my weekly review, the projects with a “date” in the past.
I tried a set up and advanced query but it does not work (as you can imagine) and my guess is that I don’t grasp the complexity of reference page when comparing dates.
#+BEGIN_QUERY
{:title ["🎯projects to review"]
: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 :🗓️) ?review]
[(> ?review ?today)]
]
:collapsed? false
}
#+END_QUERY
I can use a simple query to list all the project pages and sort by clicking on the “ ” column .. but I would really know what I’m missing above.
Thanks in advance !
anneC
October 19, 2025, 2:54pm
3
Hello mentaloid,
you’re right about the lack of detail in “does not work” behaviour description
let me add some details: I created 2 project pages where the “ ” property points to
project A: link to yesterday’s journal page
project B: link to tomorrow’s journal page
with the query I got the 2 projects listed as result
if I revert the comparison
[(< ?review ?today)]
no page is listed.
I remember a post with
:block/journal-day
I will dig to see how to convert the value of my property to this format…
Thanks!
anneC
October 19, 2025, 3:16pm
4
this query works - not sure it’s the best format
#+BEGIN_QUERY
{:title [“ 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 : ) ?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 [“ 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 : ) ?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