Search/Query notes Between dates (like in Logseq or Roam)?

Hi! Is there a way to search/query all notes between specific dates (maybe using Dataview plugin) ? I have Yaml Frontmatter “Created date” field.
But how to find all notes between dates i can’t understand…
In Roam/Logseq i just query something like {between: [[January 1st, 2020]] [[May 1st, 2020]]}} .
Thanks!

1 Like

You can do that with Dataview plugin.

  1. All notes have an implicit creation date. If you use Dataview that implicit field is named “file.cday” (the date that the file was created) or “file.ctime” (the date+time that the file was created). If for you the file.cday (or file.ctime) is ok, you don’t need to add any field in frontmatter. For this case your query need to be something like this:
```dataview
TABLE file.cday
FROM ""
WHERE file.cday >= date(2021-10-01) AND file.cday <= date(2021-10-30)
SORT file.cday DESC
```
  1. If you want to ‘control’ the creation date and need a field in frontmatter, attention: Dataview doesn’t like frontmatter fields as expressions, i.e., don’t use “Created date:” (because spaces) but “Created-date” or similar. In this case, use a query like this:
```dataview
TABLE Created-date
FROM ""
WHERE Created-date >= date(2021-10-01) AND Created-date <= date(2021-10-30)
SORT file.cday DESC
```

EDIT: you can replace TABLE for LIST

3 Likes

:star_struck: OMG so simple and powerful, thank you very much!

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