This.file.day in Dataview returns empty date

Hi, I’m trying to create a basic Dataview query to put into a daily notes template that will list all the notes created on the same day as the daily notes. I’ve seen several examples of this being done that all look something like

LIST 
WHERE file.cday = this.file.day

However, when I try this in my vault, it brings back no results, even though I have several files that have the same creation date as the note in which I am running the query. I did this followup query:

TABLE this.file.day
LIMIT 5

And I got this result:

So there are definitely files created the same day as the test file, but their this.file.day value is null, and I don’t know why. Any ideas?

This is Obsidian v1.1.16 running on an M1 Mac mini.

Hi @RobertTalbert ,

You seem to want the creation date, which is file.cday, not file.day.

file.day refers to the date in the title of the file, if any.

More info here: Metadata on Pages - Dataview

Hope this helps,

Craig

1 Like

Thank you, that seems to be it. In the original table I changed the query to WHERE file.cday = this.file.cday and that seems to be producing the right results.

I think other people posting examples might have been posting typos, for example this page definitely uses this.file.day.

1 Like

this.file.day will work if the file name can be queried:

Only available if the file has a date inside its file name (of form yyyy-mm-dd or yyyymmdd), or has a Date field/inline field.

The person on the link you gave is using a file-naming format that can be queried using this.file.day.

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