Is there any way to query all blocks with the tag #meeting
and with a date::
property of the relative date today or later? In other words, it filters out any past meetings.
There are ways to filter out past meetings. But what do you mean by “date property”? It should be something easily comparable. If you share some example blocks, we could build a query for you.
Sure, here is an example block:
Noelle/Lindsay 1:1 #meeting
date:: [[September 9, 2024]]
Noelle/Carmy 1:1 #meeting
date:: [[September 12, 2024]]
In this exaample, I’d want the query to return the meeting with Carmy, but filter out the meeting with Lindsay that was on the 9th, since the date has passed.
Try this:
#+BEGIN_QUERY
{
:inputs [:today]
:query [:find (pull ?b [*])
:in $ ?today
:where
[?meeting :block/name "meeting"]
[?b :block/refs ?meeting]
[?b :block/refs ?journal]
[?journal :block/journal-day ?date]
[(>= ?date ?today)]
[?journal :block/name ?date-n]
[?b :block/properties ?props]
[(get ?props :date) ?date-v]
[(contains? ?date-v ?date-n)]
]
}
#+END_QUERY