Eroxx
September 30, 2021, 2:26am
1
Things I have tried
Hi!
I would like to see a list of all the tasks I have completed in the last seven days, organized by date completed, newest first.
But first I need help just with the tasks I’ve done in the last week … I have this, but it doesn’t show anything:
done before one week
What I’m trying to do
I’m a novice too but try:
done after 1 week ago
sort by done
or (with \ removed):
\```dataview
TASK WHERE completed
AND file.mtime >= date(today) - dur(1 day)
SORT file.mtime Desc
\```
Eroxx
September 30, 2021, 12:04pm
3
Wow, that works, thank you!
One question though, some tasks don’t show a date completed for some reason (they simply have a check through it)
Without seeing the output I can’t say but I am speculating that you are seeing the name of a note e.g. daily note with the completed tasks beneath it?
Made some tweaks:
TASK WHERE completed AND completion >= date(today) - dur(7 day) SORT completion desc
1 Like
Eroxx
September 30, 2021, 4:04pm
5
I’m trying to learn the syntax for all this, and as a simple test, wanted to create a query to see all tasks completed in the current day.
But this returns 0 results:
TASK WHERE completed AND completion = date(today)
But strangely, this returns expected results:
TASK WHERE completed AND completion != date(today)
TASK WHERE completed AND completion >= date(today)
Eroxx
September 30, 2021, 5:13pm
7
Ok so this is odd (and thank you by the way!) –
It is showing tasks from one note, some of which I did yesterday and some of which I did today.
If I change the “>=” to just “=” it shows nothing, which I don’t understand.
oops. mnvwvnm beat me to it.
I don’t know but I suspect when it is = to it is asking for the task that were completed at EXACTLY midnight today. FYI that completion field defaults to last modified time if the completion field is not populated. If you modified a task task today (and it was already completed) it will show as a result in this query.
I’m trying to figure this out myself but I believe you would populate it with inline metadata in your task:
[completion:: yyyy-mm-dd]
Eroxx
September 30, 2021, 5:32pm
10
When I complete tasks, they are annotated like the first example you gave (the green and white checkmark)
So for it to work the way I want it to, I’d have to add metadata for each completed task?
Thank you both!!!
mnvwvnm
September 30, 2021, 5:36pm
11
I don’t use (for now) tasks queries. But I follow the last dataview updates and the developer added some new functions to tasks queries:
https://blacksmithgu.github.io/obsidian-dataview/data-annotation/#tasks
If so, you are using another plugin to this auto-annotation. If it works correctly with dataview, I don’t know.
Eroxx
September 30, 2021, 6:01pm
12
Yeah, I use the “tasks” plug-in.
system
Closed
October 30, 2021, 6:01pm
13
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.