Hi there,
I have been looking for hours but couldn’t find how to achieve it. Anyone knows how to query for all tasks scheduled or deadlined for today?
Thanks very much!
Hi there,
I have been looking for hours but couldn’t find how to achieve it. Anyone knows how to query for all tasks scheduled or deadlined for today?
Thanks very much!
There’s a lot of task related queries here:
Though I don’t think this one specifically.
So here’s your specific one:
#+BEGIN_QUERY
{:title [:b "Today's tasks"]
:query [:find (pull ?b [*])
:in $ ?day
:where
[?b :block/marker ?m]
[(contains? #{"TODO" "DOING"} ?m)]
(or
[?b :block/scheduled ?day]
[?b :block/deadline ?day]
)
]
:inputs [:today]
}
#+END_QUERY
Is there a way to adapt this query to pull tasks that are scheduled for the current day by the repeater? For example, if the current day is 2023-11-23, pull the task marked SCHEDULED: <2023-11-21 Tue .+2d>
as well.
The idea of the repeater is that when you mark a task as done it will move the scheduled date the desired amount of time from the original scheduled date.
So in this case from 21st of Nov to 23rd.
As the repeater in the data only exists as plain text, it is not (easily) possible to get the data and modify the date. We have no date manipulation functions as a date format isn’t implemented in advanced queries.
In other words the ?day in the query is not a date but actually a number e.g. 20231123.