Automatic "On this day x years ago" for Daily Notes

What I’m trying to do

I am trying to add an automatic feature to my daily notes that lists events that have happened (and I have a note for) on the day of my current daily note “x” years ago. For example, the SpaceX Super Heavy Booster landing was on October 13th. When I eventually get to my Daily Note next year on October 13th, 2025, I would like to be reminded that the Starship landing happened one year ago on that day, inside of the auto-generated note.

Things I have tried

My only idea at the moment is to add a specific date format (that doesn’t include the year?) to the frontmatter of all of my notes that I would want to be recalled in later daily notes. This could possibly be retrieved by some sort of code from the Templater plugin to the Dataview plugin. I unfortunately have almost no experience with code.

I could likely get a similar effect by using backlinks, but that is not quite what I am looking for.

Has anyone done this? Is there a feasible way of doing this with Templater and/or Dataview?

Does the similar topic and Dataview solution below fit your needs? :crossed_fingers:

1 Like

Thank you for that link, that was helpful and it looks like that gets me close! At the moment, the code brings up a list of ALL of my files.

The way things are set up, the title of all of my Daily Notes is in the dddd, MMMM DD, YYYY format. I also have an automatic link to my current daily note in every new note made by using [[{{date}}]] in the front matter. Like so:

I’m not sure if I did it correctly, but I tried changing the date format in the code from your other post to match mine, but it still lists and links all of my files.

TABLE WITHOUT ID
	link(file.link, dateformat(file.day, "ccc, dddd MMMM DD YYYY")) AS 📅
FROM
	""
WHERE
	 file.day.day = this.file.day.day
	AND 
	file.day.month = this.file.day.month
SORT 
	file.link
	DESC

Is there a way to modify this retrieval code to use a date in the Properties dropdown instead of a date from the file name? For example, I may make a note of something after it has occurred, but would want the data of occurrence to be the one Dataview searches for, not the date the note was created.

Another approach is to add an embedded search to the daily note template. (Example assumes your daily notes folder is named “Daily notes”.)

~~~query
path:/Daily notes/
file: {{date:MMMM DD}}
~~~

I only know how to work with files that follow the ISO8601 notation used by Dataview. I don’t know how to query the type of file names you are using for your daily notes. Hopefully someone else can offer a solution.