Query tasks for tomorrow / today

Hello,

Sorry to trouble you all, I’ve been playing around with no joy and did do a brief search.

Is there a way to do a query that does this:

Find “now” tasks dated for today

I know how to display “now” tasks, but for example I’ve put a date on a task, and when that date becomes today, I would like just that task displayed.

Thanks in advance!

Chris

Yes, there are ways, but you are not specific enough.

  • Logseq has a built-in NOW query.
    • Find it in file config.edn
  • If by “dated for today” you mean “scheduled for today”, could use something like this:
     :inputs [:today]
     ...
       :in $ ?today
       ...
         [?b :block/scheduled ?d]
         [(= ?d ?today)]
    
  • Otherwise, be more specific by sharing:
    • some example blocks
    • your current query
1 Like

Sorry for the poor comms @mentaloid

This might be more helpful.

Say I have a page relating to changes to a room

I’ve done most tasks, but I would like to display jobs to be done today - i.e. plasterboarding (today is the 11th, the task is set for tomorrow).

So far I’m capable of give a heading and below it, a query with the simple /query option, but at the moment I can only use a date range:

{{query (task NOW) (between [[May 11th, 2025]] [[May 15th, 2025]]))}}

This provides this output

What I would like to do, is instead of giving a date range, say

show tasks 'NOW' AND for 'TODAY'.

Playing around a little further, I see that doing this query, the plasterboarding dated for 12th, is still being shown despite the date range being between 13th and 15th:

{{query (task NOW) (between [[May 13th, 2025]] [[May 15th, 2025]]))}}

I was hoping this was possible as I note the docs suggest today/tomorrow is a possible function (please excuse me if I’m using the wrong phrasing).

https://docs.logseq.com/#/page/queries

I must admit, I’m confusing things a little, because a task is not technically NOW until the date arrives. The day before the NOW task, it should not display. But on the day of the task, I would hope that it would show, because I’ve asked for “NOW” tasks to be shown “TODAY”.

I do hope that makes sense, thanks again in advance.

  • Yes, it is quite confusing to use NOW for a task that is actually for later.
    • You may prefer to just use TODO instead.
  • between range checks the journal page a task is in.
  • In contrast, your block example contains a reference to the journal page.
    • Try this advanced query:
      #+BEGIN_QUERY
      {
       :inputs [:today]
       :query [:find (pull ?b [*])
         :in $ ?today
         :where
           [?p :block/journal-day ?d]
           [(= ?d ?today)]
           [?b :block/refs ?p]
           [?b :block/marker "NOW"]
       ]
      }
      #+END_QUERY