Exclude already-scheduled tasks and tasks from today's journal

@Siferiax Thanks for the helpful selection of queries and your ongoing effort to answer other peoples questions!
Here’s mine:
I’ve been using some of your queries for quite some time now with minor changes. I figured that I don’t want my “Slipping” query to show tasks from todays journal. And also not those from the past days that are already scheduled.

I tried excluding the tasks from today by appending a -1d at some places in the code as I have no idea what I’m doing but to no avail.

Here’s a post with another syntax that I cannot figure how to integrate into my query

        [(>= ?d ?start)]
        [(< ?d ?today)]

I found the snippet [?h :block/scheduled ?d] but have no idea how to integrate it such that tasks with scheduled date are filtered out.

Here’s my current query:

#+BEGIN_QUERY
{:title "🟠 SLIPPING (open task from last days)"
  :query [:find (pull ?b [*])
          :in $ ?start ?today
          :where
          (task ?b #{"NOW" "LATER" "TODO" "DOING"})
          (between ?b ?start ?today)]
 :inputs [:-14d :today]
  :result-transform (fn [result]
                      (sort-by (fn [h]
                                 (get h :block/created-at)) result))
  :group-by-page? true
  :collapsed? true
  :remove-block-children? false}
   ]
 }
#+END_QUERY
  • To exclude today from your range, should normally:
    • replace :inputs [:-14d :today] with either:
      • :inputs [:-14d :yesterday]
      • :inputs [:-14d :-1d]
    • optionally replace all ?today with ?yesterday for clarity
  • To exclude your scheduled tasks, should normally use:
    (not [?b :block/scheduled])
    

Works like a charm! Thanks.
So clear now that I am shocked I could not resolve it myself.