Help with Base formula to Filter "within the past month"

What I’m trying to do

I’m trying to create a base view in my Monthly note template that is filtered to show notes I’ve created or edited within the current month and/or the past 30 days.

IDEALLY show notes I’ve created within the current month, knowing I would probably need to ensure that the metadata in the Monthly template has a reference to build on, like creation date.

OR

AT LEAST include a base that shows notes that were created on or before Today and on or after 30 days ago.

Things I have tried

I tried making it work with “out of the box” Base filters, and even tried creating my own formula using the Bases documentation, but was never able to get it working. I searched the forum as well, but didn’t find anything that fit the bill.

Any help or guidance would be greatly appreciated.

  1. What in your monthly note tells you the date range it covers, and in what format?

    For example, if the month and year are in a property (or two properties), then what’s the property name and its value’s format? Or if the year and month are only in the note title, then what’s the format there? Or if you rely on the folder’s path, then etc.

  2. What in your daily note tells you its created and modified dates?

    That is, if you have custom date-type properties for this, then what are the property names?

    It’s possible to use the dates managed by your OS (referenced by file.ctime and file.mtime), but if you go this route, then know that various copy, sync, and update functions can change those dates and leave you recordless for retrieving the original dates.

1 Like

Hi, I have both created and modified fields set up for my notes, but I haven’t figured out how to create a usable filter for them. I’m trying to start with a “created time is on or before” filter, but:

A) I haven’t been able to create advanced filtering that amounts to “created time is on or before today.”
B) I’ve found that if you use longer filter parameters like “on or before,” the filter fields bleed off the edge of the pop-up, which makes it impossible to activate advanced filtering. :man_shrugging:

I think this is the same question I asked a few months ago. The answer is in that thread.

filters:
  and:
    - file.mtime > now() - "1 month"
1 Like

Thanks for sharing this. I searched before posting, but didn’t find your post. Much appreciated.