# Can't seem to limit table to just a specific month

**URL:** <https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764>\
**Category:** Basement\
**Tags:** dataview\
**Created:** [November 27, 2021, 9:35pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764 "2021-11-27T21:35:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![htmljenn](https://forum.obsidian.md/user_avatar/forum.obsidian.md/htmljenn/32/21982_2.png) [@htmljenn](https://forum.obsidian.md/u/htmljenn)\
**Post date:** [November 27, 2021, 9:35pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764/1 "2021-11-27T21:35:50Z")

</div>

I have a group of daily notes in a folder “timely.” They are all named by the date YYYY-MM-DD they were written. When I write a table looking for the file.name as a date it displays them as expected:

```dataview
table without id file.name, date(file.name).month as Date
from "timely"
sort file.ctime desc

```

however, when I add the where statement to limit to just this month, it fails.

```dataview
table without id file.name, date(file.name).month as Date
from "timely"
where date(file.name).month = date("2021-11-27")
sort file.ctime desc

```

I have tried changing the where statement to:

- where date(file.name).month = “2021-11-27”
- where date(file.name).month = “2021-11”
- where date(file.name).month = “11”

as well as using the file.day function:

- where date(file.day) = date(“2021-11”)
- where date(file.day) = date(“11”)
- where date(file.day) = “11”

And a bunch of other stuff. I can list them if you want to see them.

I have searched Duck Duck Go for dataview obsidian monthly review, dataview obsidian file.day and a bunch of other searches.

I have searched in this forum for similar search strings. I have relied heavily on @arminta’s post in here " [Daily and Weekly Reviews + dataview](https://forum.obsidian.md/t/daily-and-weekly-reviews-dataview/17021)" It has gotten me all the way to a working weekly review, and I am VERY grateful for it. Thank you!

### What I’m trying to do

I am trying to create a template for my monthly reviews that looks at the current date and the date in the file name of the file to pull out various bits of data with dataview.

I don’t want to use ctime or mtime because these notes might be created well in advance of the day they are written for (for instance, I note calendar entries in my calendar before the day they are scheduled to happen, so I can remember to attend the events…). And they may be modified at any time as well.

I will use templater to set the specific date entries - so for testing above I’m not worried that it’s using today’s date as the default. BUT I don’t want to assume that I’m writing the review in the same month that I’m reviewing.

---

<div class="post-metadata">

**Author:** ![liam](https://forum.obsidian.md/user_avatar/forum.obsidian.md/liam/32/3070_2.png) [@liam](https://forum.obsidian.md/u/liam)\
**Post date:** [November 27, 2021, 9:42pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764/2 "2021-11-27T21:42:36Z")

</div>

Hi, I think something closer to this should work:

```auto
table without id file.name, date(file.name).month as Date
from "timely"
where date(file.name).month = 11 and date(file.name).year = 2021
sort file.ctime desc

```

When comparing `.month` and `.year` things, the values are just numbers, so they don’t need to go in quotes.

---

<div class="post-metadata">

**Author:** ![htmljenn](https://forum.obsidian.md/user_avatar/forum.obsidian.md/htmljenn/32/21982_2.png) [@htmljenn](https://forum.obsidian.md/u/htmljenn)\
**Post date:** [November 27, 2021, 9:43pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764/3 "2021-11-27T21:43:10Z")

</div>

Okay, I’m closer:

```auto
dataview
table without id file.name, date(file.name).month as Date
from "timely"
where date(file.day).month = date(2021-11-01).month
sort file.ctime desc

```

This gets me a table like I want, BUT it culminates in an error message:

> Dataview: Every row during operation ‘where’ failed with an error; first 3:
> 
> ```
> - No implementation of 'date' found for arguments: object
> 
> ```
> 
> - No implementation of ‘date’ found for arguments: object
> - No implementation of ‘date’ found for arguments: object

I’m guessing that is because there are files in that folder that don’t match the YYYY-MM-DD format.

Any ideas what I can do about this?

---

<div class="post-metadata">

**Author:** ![htmljenn](https://forum.obsidian.md/user_avatar/forum.obsidian.md/htmljenn/32/21982_2.png) [@htmljenn](https://forum.obsidian.md/u/htmljenn)\
**Post date:** [November 27, 2021, 9:45pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764/4 "2021-11-27T21:45:47Z")

</div>

Awesome, that worked too, and would be better than my initial idea as I wouldn’t be seeing every year’s November listings.

I’m still seeing the error message (because of the mis-named files) and I’m debating just moving those somewhere else as a kludge.

Thank you!

---

<div class="post-metadata">

**Author:** ![liam](https://forum.obsidian.md/user_avatar/forum.obsidian.md/liam/32/3070_2.png) [@liam](https://forum.obsidian.md/u/liam)\
**Post date:** [November 27, 2021, 9:50pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764/5 "2021-11-27T21:50:21Z")

</div>

Oh, I see what you mean now. For that issue, I think you want to do the following then:

```auto
table without id file.name, file.day.month as Date
from "timely"
where date(file.name).month = 11 and date(file.name).year = 2021
sort file.ctime desc

```

Dataview already does some magic to convert filenames to dates. So I think if it can’t find a date in the filename it will just show `-` instead of the error.

Use `file.day as Date` for it to show the full date (i.e. “November 11, 2021”) etc.

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [November 28, 2021, 9:51pm UTC](https://forum.obsidian.md/t/cant-seem-to-limit-table-to-just-a-specific-month/27764/6 "2021-11-28T21:51:10Z")

</div>

Closed on November 28, 2021, 9:51pm UTC

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