Using Frontmatter fields in dataview DQL searches

What I’m trying to do

Things I have tried

I am trying to create a dataview table to show all the files I created on a certain day.
I use a filter like WHERE file.cday = date(today) or date(2023-05-11)
Both options work fine when I use them in today’s daily note, but ofcourse it doesn’t work on yesterdays daily note. Then I could use date(yesterday) but this does not work on older days.
So I started testing variables that would generate the exact date that corresponds to the creation date of my daily notes.
First thing I tried is using the filename of the note, after all, that is named after the date it was created on.
Unfortunately WHERE file.cday = date( or file.cday = date(“”) does not work.
Then I tried using YAML fields on my daily notes that I could automatically fill with the creation date by using Templater, either as Frontmatter fields, or as inline fields.
So I would have something like

creadate: 2023-05-11

But again, unfortunately my code: WHERE file.cday = date(creadate)
or WHERE file.cday = date(“creadate”) does not work either.
After spending several hours after midnight I am getting desperate. Nothing seems to work. I am wondering if te problem lies in my first brain or in my second brain :wink:
Is there anybody out there who could hand me a solution, or explain to me what I am doing wrong?
Anyway, have a great day you all.

If you use file names with YYYY-MM-DD, does the following work?

WHERE file.cday =
or file.mday =
SORT file.mtime desc

Yes, Brilliant.
thanks a lot eightning or from now on lightning.
:pray: :pray: :pray:

1 Like

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