Dataview - show files modifed in last 40 days

What I’m trying to do

I set up a working dataview for my most recent files in a folder called “Personal”. I moved a few things round though and here is what is now says:

table dateformat(file.mtime, "DD.MM.YYYY, HH.mm") AS "Last modified" FROM "Personal" SORT file.mtime DESC LIMIT 40
```

##

THIS IS WHAT IS SAYS IN EDIT MODE:

Dataview: Error: 
-- PARSING FAILED --------------------------------------------------

  1 | table dateformat(file.mtime, "DD.MM.YYYY, HH.mm") AS "Last modified" FROM "Personal" SORT file.mtime DESC LIMIT 40
> 2 | ```
    | ^
  3 | 
  4 | ##

Expected one of the following: 

'*' or '/' or '%', '+' or '-', '>=' or '<=' or '!=' or '=' or '>' or '<', 'and' or 'or', /FROM/i, EOF, FLATTEN <value> [AS <name>], GROUP BY <value> [AS <name>], LIMIT <value>, Not a comment, SORT field [ASC/DESC], WHERE <expression>, whitespace




### Things I have tried

Search for solutions here but none found. Quite a newbie!

First of all you probably want to adjust your date formatting as follows:

table dateformat(file.mtime, "dd.MM.yyyy, HH.mm") AS "Last modified"
FROM "Personal"
SORT file.mtime DESC LIMIT 40

Because your source would result in a date output like this:
5. Sept. 2024.09.YYYY, 17.39

Now the above query works perfectly well here, give it a try and mind to copy the whole sourcecode including starting end ending backticks as much as the command dataview.
Just mentioning, for in your example code this is missing…

Thanks for that! I made those changes and everything is working again!

1 Like