Deactivate or freeze dataview/tasks in old daily notes?

What I’m trying to do

I’ve got a lot of daily notes, all with embedded queries that pull up tasks for different time periods using various filters (priority/waiting etc). It occurs to me that every time I update a task, obsidian has to go back and update all those old daily notes. Is there a way to “freeze” a note after it is a day old? So that it is a record of what was done on that date and not being updated forever?

You’re touching in on two different issue here, and I’m not clear which one you are referring to.

Using dynamic queries

If you in your daily notes use a query like:

```dataview
LIST WHERE file.mday = date(today)
```

This would broadly speaking be listing all files modified today. However, if you pull up a daily note from last year with the same query, it’ll still list the same files since date(today) will always be “today”.

To count this issue, it’s common to rather use Templater (or the core Template ) plugin to have the query use a fixed date, like in:

```dataview
LIST WHERE file.mday  = date("2024-04-17")
```

When you open a note with this query in it, it’ll always to refer to that fixed date.

Triggering old queries

The other variant which could be considered based on your request would be what happens when you’ve got many, many files with queries, will these be updated if you change something in the vault?

The answer to that is that Obsidian (and Dataview) will not go back and update queries in old notes. Only when you actually open one of the older notes, will the queries within that particular note be executed again and show the “current” results of that query. A close file/note will not have its query executed before being opened.

1 Like

What you said about Triggering old queries is what I was trying to ask about. I didn’t realize that unopened notes don’t get updated, even though the links in them do (if you change a linked note title for example). Thanks

1 Like

Hi there,
I have a similar problem, which is why I am posting here: My Daily Notes have a dataview component which pulls up the query for the day, with the day hardcoded as shown in @holroy’s answer.
The reason why I want the queries to be frozen after the day shown in the dataview query is that I might modify one of the notes listed there, than this note would disappear from this days view, right?
What I want to achieve is that, through backlinks, I can see on which days I have worked on a specific note, and for that it is my understanding that the content in the note has to be fixed and can not be dynamic.
So, my question is: Is it possible to have the dataview queries frozen? Ideally, this would be triggered at the end of the day, or if that is not possible, whenever I call up the daily note for the following day at the next morning.
Has anybody an idea how to achieve this?