How can I effectively list tasks that meet the specified conditions? #2533
-
I need to display non-recurring tasks that are due today or within the next week. I have used the following code:
However, the filtered results do not match the requirements, as shown in the following image: How can I optimize the code to achieve the desired outcome?" |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 13 replies
-
I am not in front of a computer, so cannot experiment with this right now. So I will tell you how to fix it yourself.
You need to put brackets around every part of combined queries, and spell AND and OR with capitals, so it will be something like:
|
Beta Was this translation helpful? Give feedback.
-
If I revise the code to:
But the results are still incorrect, and it doesn't accurately filter out tasks that meet the criteria. The outcome is shown in the following image: One eligible result is missing. |
Beta Was this translation helpful? Give feedback.
-
If I modify the filtering criteria to:
The filtering results are as shown in the image, and I'm not sure of the reason. |
Beta Was this translation helpful? Give feedback.
-
And if you still have a problem, then paste the missing task in here as text and I will look at it later. If I can’t see the data, I can’t help. |
Beta Was this translation helpful? Give feedback.
-
I am now in front of a computer and can test your queries. Whenever the Tasks results are not want you want, the best action is always to add an Meaning of 'due in 1 week'
I added the explain instruction to the following query: The query:
The search results begin with:
The key here is the word There is a table in the documentation that explains this - see Date search options: The problem is that Fixing the searchHere are some example other ways that you can write what you may want - with their
The date searches in Tasks have evolved a lot this year. Myself and The above is all explained thoroughly, with examples: https://publish.obsidian.md/tasks/Queries/Filters#Searching+date+ranges |
Beta Was this translation helpful? Give feedback.
I am now in front of a computer and can test your queries.
Whenever the Tasks results are not want you want, the best action is always to add an
explain
line, and it will show how your query is interpreted.Meaning of 'due in 1 week'
I added the explain instruction to the following query:
The query:
The search results begin with: