Dataview query rendered fine in Editing Mode and shows an error in Reading Mode

Hi everyone!

This is my first time posting here, and English is my second language, so please excuse me in advance for any posting mistakes I might make.

I have a question regarding as why the query rendered correctly in Editing Mode and shows an error in Reading Mode.

What I’m trying to do

To see the same results in both view modes and understand what is happening.

Things I have tried

I read all the related posts that I could find but didn’t find an explanation and a solution to this particular problem where the query works fine in one mode but does not render properly in the other.

This is the code that I use in all my Daily Notes:


TABLE string(split(string(file.ctime), " - ")[0]) as "Created", file.mtime as "Last Modified"

WHERE contains(file.path, "2023-04-18")

  OR (file.cday = date("2023-04-18") AND !regexmatch("^\d{4}-\d{2}-\d{2}", file.name))
  OR (file.mday = date("2023-04-18"))

SORT file.name ASC

This is the result in Editing Mode:

And this is the result in Reading Mode:

Why is there a   in front of your OR statements?

I would try deleting the indentation before those OR statements, and see what happens. It seems like you’ve somehow managed to get some illegal characters in there.

```dataview
TABLE string(split(string(file.ctime), " - ")[0]) as "Created", file.mtime as "Last Modified"

WHERE contains(file.path, "2023-04-18")

  OR (file.cday = date("2023-04-18") AND !regexmatch("^\d{4}-\d{2}-\d{2}", file.name))
  OR (file.mday = date("2023-04-18"))

SORT file.name ASC
```

This query functions nicely in my test vault. (Whether it produces what it should is another matter, but it works in both reading and live-preview).

Thank you very much!!!
That’s correct, deleting the indentations solve the problem

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