Can I search by part of a date?

Can I search, using properties, for dates that include a certain month? (ETA for clarification: I want to be able to search, for instance, for all notes with dates from October, regardless of the year.) I don’t know if there’s a way to do that using wildcards or something. Or a plugin, maybe.

It’s definitely possible with the Dataview plugin. What does your date property look like? Can you provide an example?

1 Like

It kind of depends on where you want to search for these parts of date. Dataview is indeed a good alternative, but some can also be done from the search interface.

Like if you’re using “YYYY-MM-DD” as file names, you could use path: /\d{4}-11-/ (or `path: //\d{4}-11-/) to search for all notes using the file name pattern from November.

2 Likes

It’s in date format. Like this:
image

Could you please show the same data in source mode? Obsidian displays dates in the Properties header differently than it stores it.

You’re note format appears well formatted, so @holroy 's suggestion of using the core built-in Search plugin is probably a very good 1st choice.

Assuming it’s in standard YYYY-MM-DD format , to search for all notes with a Date property in October, (i.e. the 10th month), you could copy the following in your Search box

[Date:/\d{4}-10-\d{2}/]

If you wanted to have this embedded in a note, you could copy the following block into your note…

```query
[Date:/\d{4}-10-\d{2}/]
```

This query uses “Regular Expressions” which are super powerful wildcards.

The search I suggested is looking for all notes containing a property named Date which has a value of ####-10-## where # represents any numerical “digit”. So only notes with a 10 in the months position would be selected.

If this isn’t what your looking for, let us know and we could suggest a solution using Dataview.

1 Like

Sorry for not showing the source code. I’m still trying to get my head around properties, finding the earlier YAML more intuitive. It is formatted just as in your example, so this is exactly what I was looking for. Thank you so much!

1 Like

Quick follow-up question: is there a simple way to get it to display the number of results found? Or would I then be into “need-to-use-Dataview” territory?