Dataview does not list all the files created on the same day as my daily note

.

What I’m trying to do

I want dataview to provide a list of all the files created on the same day as my daily note

Things I have tried

LIST
WHERE date(created) = this.file.day
SORT file.name ASC
LIST
WHERE file.cday = date("<% tp.date.now(\"YYYY-MM-DD\") %>")
AND file.name != "<% tp.date.now(\"YYYY-MM-DD\") %>"
SORT file.name ASC
LIST
WHERE datecreated = this.file.day
LIST
WHERE file.cday = this.file.day
LIST
WHERE file.cday = this.file.cday

I’ve tried a lot of stuff and nothing works, please do help

First, I’m always careful about using file.cday or file.ctime. These are the dates/times when the file was created. If you create a daily note in advance, then the creation time is the day you created the file even though the daily note date is different.

Second, I’m assuming that the daily notes have names like “2024-03-22”. Then one way to get the “date” for that file is to use date(file.name). This way you know that the date object corresponds to the date of the daily note (which may not be the same as it’s creation date). However, you have to use date(this.file.name) in the dataview query to tell dataview to use the file.name of the daily note that the query is running from.

So I use “where file.cday = date(this.file.name)”. This gives me all of the files that were created on the date of the daily note. The “this.” in the date says to refer to the current file (the daily note). “file.cday” will get the cday from the file that dataview is filtering (since there is no “this.”)

This works for me. Hope it helps.

LIST WHERE creation-date = this.creation-date

You need to inform us on what fields/properties you’ve got in your files, and what name schemes you’re using for file names. Without this we’re just guessing on your setup, and will most likely not give you good answers.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.