Setting up an advanced query to fetch all upcoming TODOs AND blocks mentioning a day in the next 7 days

Hi all,

I’m a new to Logseq and Advanced Queries. Hope I can get some help here. I was looking into this solution for getting a list of all upcoming TODOs in the next few days / week. So far everything is clear. However, does anyone have an idea, how this can be extended to also list blocks that contain (!) a date within the next 7 days? I managed to set up an advanced query that is listing ONLY those blocks that mention a day. But I did not manage to get a combined list of both, the ToDos (w/ deadlines or ‘scheduled’ property) and the blocks just containing a date.

I’d be super happy if anyone could either direct me to a place where I could learn how to set this up or even provide a code snippet …

Thanks a lot in advance!

Hi Erikk,

I think the following resources can be useful to you:

  1. I think your wanted query is among the examples in the official Logseq Docs for advanced queries

  2. Here are some examples of saying “until some day” - use the same to also add “after/starting with some day”
    Advanced Query for NOW or due today/overdue

  3. Logseq Database schema
    logseq/schema.cljs at master · logseq/logseq · GitHub

  4. Datomic reference. The language behind logseq advanced queries
    Datomic Queries and Rules | Datomic

1 Like

thx a lot, will have a look!