Advance Query - Schedule and Deadline Date

Hi,

Need helps on the advance query. How to query the schedule date or deadline date instead of date.

The following query only result the block with date but not schedule or deadline.

#+BEGIN_QUERY
{:title "πŸ“… THIS WEEK"
    :query [:find (pull ?h [*])
            :in $ ?start ?next
            :where
            [?h :block/marker ?marker]
            [?h :block/ref-pages ?p]
            [?p :page/journal? true]
            [?p :page/journal-day ?d]
            [(> ?d ?start)]
            [(< ?d ?next)]
            [(contains? #{"NOW" "LATER" "DOING" "TODO" "WAITING"} ?marker)]]
    :inputs [:today :7d-after]
    :collapsed? false}
#+END_QUERY

Anyone can help, please.

Is this what you’re looking for @vincentteoh ?

{:title "next week deadline or schedule"
    :query [:find (pull ?block [*])
            :in $ ?start ?next
            :where
            (or
              [?block :block/scheduled ?d]
              [?block :block/deadline ?d])
            [(> ?d ?start)]
            [(< ?d ?next)]]
    :inputs [:today :7d-after]
    :collapsed? false}
6 Likes

Yes, thank you very much for your help!