Advanced Query for NOW or due today/overdue

seems like actually the 1d-after is broken in 7.0.0.
See the comments here on github.

Consider simply replacing :1d-after with 99990101 (01 January 9999). But if you are still around at that date, don’t forget to update the queries :slight_smile:

Hence, the result is:

#+BEGIN_QUERY
{ :query [:find (pull ?b [*])
  :in $ ?today ?tomorrow
  :where
    [?b :block/marker ?m]
    (not [(contains? #{"DONE", "CANCELED"} ?m)])
    [(get-else $ ?b :block/scheduled ?tomorrow) ?scheduled]
    [(get-else $ ?b :block/deadline ?tomorrow) ?deadline]
    (or 
      [(contains? #{"NOW", "DOING"} ?m)]
      [(<= ?scheduled ?today)]
      [(<= ?deadline ?today)])]
:inputs [:today 99990101]
:result-transform (fn [result]
  (sort-by (fn [h]
    (get-in h [:block/scheduled])) result))
:breadcrumb-show? false}
#+END_QUERY
1 Like