Is there a way to query notes from a particular date in Obsidian?

Is there a way to fetch latest 10 notes sorted by modified date ?

search only provides these options

17Sep 1136AM 0

1 Like

With dataview:

```dataview
LIST
FROM ""
WHERE date(today) - file.mtime
WHERE file.name != this.file.name
SORT file.mtime DESC
LIMIT 10
```

Works as you need?

Angel

1 Like

@anon12638239 It works, but I use a plugin called “Zoottelkeeper”, which automatically updates index files inside every folder.

So, it shows up those index files also.

Is there a way to exclude certain files ?

I tried

```dataview 
LIST FROM "" WHERE date(today) - file.mtime 
WHERE file.name != this.file.name  
OR "🏷 AREAS 📂" 
OR "🏷 Crypto 🧊" 
SORT file.mtime DESC LIMIT 10 

It does not gives any parse error but does not exclude the files.

1 Like

@anon12638239 Figured it out. This works.

LIST FROM "" WHERE date(today) - file.mtime 
WHERE file.name != this.file.name  
AND file.name != "🏷 AREAS 📂" 
AND file.name != "🏷 Crypto 🧊" 
SORT file.mtime DESC LIMIT 10 

can we use wildcards like

AND file.name != "A*"

where all files starts with A are included ?

1 Like

@anon12638239

LIST FROM "" 
WHERE file.name != this.file.name
WHERE contains(file.name, "🏷")
SORT file.mtime DESC LIMIT 10

This feteches only files starting with :label:

But, is there something equelent to “does not contain” ?

As you have worked out, specific files and folders can be excluded or targeted. Not sure about wild cards, and not on a device with Obsidian on to be able to test anything, but you might be able to do some filtering with ‘contains’.

Angel

1 Like

@anon12638239 Figured out

!contains works :blush:

LIST FROM "" 
WHERE file.name != this.file.name
WHERE !contains(file.name, "🏷")
SORT file.mtime DESC LIMIT 10

Was just back at a Mac and about to try to help, but you crossed the line ahead of me. Bravo!

Great it is working for you.

Angel

1 Like

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