Dataview Parsing Failed

What I’m trying to do

I would like to use the following code to query notes created today and notes last touched today.


Notes created today

List FROM "" WHERE file.cday = date("<%tp.date.now("YYYY-MM-DD")%>") SORT file.ctime asc

Notes last touched today

List FROM "" WHERE file.mday = date("<%tp.date.now("YYYY-MM-DD")%>") SORT file.mtime asc

I receive the following error message:

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

1 | List FROM “”

2 | WHERE file.cday = date(“<%tp.date.now(“YYYY-MM-DD”)%>”)
| ^
3 | SORT file.ctime asc

Expected one of the following:

‘(’, ‘)’, ‘*’ or ‘/’ or ‘%’, ‘+’ or ‘-’, ‘,’, ‘.’, ‘>=’ or ‘<=’ or ‘!=’ or ‘=’ or ‘>’ or ‘<’, ‘[’, ‘and’ or ‘or’

Things I have tried

I’ve tried to search the forum using “dataview parsing failed” and have tried to put the code into different lines.

The <%tp.date.now("YYYY-MM-DD")%> part is Templater code.

Templater needs to be run first replacing the above with 2024-06-20 (for example). The Dataview query should be fine then.

```dataview
list 
from "" 
where file.cday = date("2024-06-20") 
sort file.ctime asc
```

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