Dataview: return current day ("Mon", "Tue")

What I’m trying to do

I have a frontmatter field (Day) where I assign a value (“Mon”, “Tues” etc)

I want to query the value from dataview in a daily note.

The following query works and finds the file

from "02-School/-Lessons" 
where Week = date(today).weekyear AND Day = "Thu"

I want to generalise the query so it returns the specific day automatically as “Mon”, “Tue” etc for the specific date. I have tried the following and it does not work.

from "02-School/-Lessons" 
where Week = date(today).weekyear AND Day = dateformat(date(today), "ddd")

I suspect I am making a fundamental syntax error and would be grateful of help on the error I am making.

Many thanks, Simon

Things I have tried

Searched forum.
Searched web.

1 Like

Hi, I have tried the following code, the first version works the second version does not return any files:

This one works:

from "02-School/-Lessons"
where Day = "Fri"

This one doesn’t:

from "02-School/-Lessons"
where Day = string(dateformat(date(today), "Ddd"))

expecting Day = string(dateformat(date(today), “Ddd”)) to return a string “Fri”

Any help very much appreciated, many thanks

1 Like


I might be barking up the wrong tree, but …

In the truncated diagnostic below, the query works when using the Luxon token EEE for day of the week, as an abbreviate localized string

Does it work with your data and longer query?

Day:: Fri

# dataview query

WHERE date(Day, "EEE")



Many thanks for your help, will test out, cheers, Simon

1 Like

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