Thanks for the hint, but it doesn’t seem to contain a solution for my case.
Maybe it makes sense to explain a bit more, what I try to achieve.
I have blocks that are scheduled (or have a deadline) that are not marked as task.
This shows me certain pieces of information when they are relevant.
These blocks show up in my query as expected.
On top I have scheduled tasks.
These show up wheter they are done or not.
But in my case, I only want to see scheduled blocks (or blocks with dealines) and scheduled tasks that are not done yet. And all this in the context of the next 7 days.
This assumes that all blocks with a scheduled or deadline date have a marker.
But they don’t. Only tasks have a marker, but I’m using scheduled dates oder deadline dates also for blocks, that only contain text and and no marker.
So the query needs to handle blocks with and without markers.
A non-task is never done.
But its date (scheduled or deadline) is out of the scope of the query.
Basically everything that is scheduled (or has a deadline) defined as yesterday or older, is never shown again.
I have a separate query for overdue tasks. So these will not slip through.
The used condition [(> ?d ?start)] already excludes everything that is for yesterday or older. So what is missing? Could you provide an example block that appears in the results, while it shouldn’t?
I have tried to provide some examples, what the query should show and what not.
The examples are with scheduled dates, but I should also work with deadlines.