How to use the day of the week in a dataview query

I am relatively new to Obsidian and am currently building a PKM for work use. I have each meeting on a separate note and have a daily page that is always up. I currently have a data view query on my daily page that lists all of my reoccurring meetings. I would like to put a day of the week tag in the meetings so only Monday’s meetings will show up in that query on Monday, etc.

The frontmatter of the meetings looks like this:

noteType::"meeting"
type::"scheduled"
day::"Monday"
relatedProject::
summary::
actionItems::
ticket::

My current dataview query looks like this:

TABLE summary AS "Summary of Last Meeting", actionItems AS "Action Items"
FROM -"z_templates"
WHERE noteType="meeting" AND type="scheduled"

What I can not figure out is how to get today’s day of the week and use that in the query to only list the meetings that will be on that day. I have not found much on the internet, and what I did try, either I did something wrong or do not have all the correct plugins. (Currently only using dataview and tasks for my work vault.)

Thanks in advance.

1 Like

This should query notes that match the current day today (Wednesday, as of writing). Is this what you want?

```dataview
TABLE 
summary AS "Summary of Last Meeting", 
actionItems AS "Action Items"
FROM -"z_templates"
WHERE noteType="meeting" 
AND type="scheduled"
AND
day = dateformat(date(today), "EEEE")
```

1 Like

Hi, I am following this post with interest. I am trying to achieve a similar thing and posted about a week ago:

I also posted on Reddit and ot this reply:
https://www.reddit.com/r/ObsidianMD/comments/15nku00/dataview_return_current_day_mon_tue/

From reddit:

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

If you test that locally, you can see that Ddd does not return a day of the week. It is not a valid Luxon token as required by Dataview.

Try these code snippets in a note:

**Here is what `Ddd` (an invalid Luxon token) returns:**

==`=string(dateformat(date(today), "Ddd"))`==

**Here is what `DDD` (a valid Luxon token) returns:**  

==`=string(dateformat(date(today), "DDD"))`==

**For an abbreviate weekday, Luxon needs `EEE`**  

==`=string(dateformat(date(today), "EEE"))`==

1 Like

Thank you so much. This is exactly what I was looking for. The dateformat() was the part that was throwing me off. I think most of what I did find was using dataviewjs and overcomplicating things for what I needed.

1 Like

Pleasure. :smiley:

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