How to use date properity in dataview?

What I’m trying to do

Dataview has it’s Implicit Fields such as file.ctime and file.mtime.
But I set some properties in the md file.
(1) date_created : format is 2023/12/01 22:08:36
(2) date_updated : format is 2023/12/19 17:32:13

When I write code in dataview:
(1) where date(now) - file.mtime <= dur(3 d) => this code can work.
(2) where date(now) -date_updated <= dur(3 d) => this code can’t work.
(3) where date(now) - file.mtime <= dur(3 d) and date(now) - file.mtime > dur(0 d) => this code can work.
(4) where date(now) - test_review <= dur(3 d) and date(now) - test_review > dur(0 d) => this code can’t work, and shows the error info.

Dataview: Every row during operation 'where' failed with an error; first 3:

                - No implementation found for 'date - string'
- No implementation found for 'date - string'
- No implementation found for 'date - string'

I don’t really know if there something wrong with the format or the code is wrong? Could you help me to solve this question? Thank you.

Your format looks like a date, but is interpreted as a string by dataview since you’re lacking a T between the date and time, see date definitions. It’s very strictly following the ISO8601 standard, with the T separator.

So then the question becomes do you have many files with this date string? If just a few I would strongly suggest to use a compliant date format as listed above. If many files, there is an option to make dataview interpret the string as a date using the date(text, format), but this would require translating your date string each time you’re using it. I would only recommend that if you’re not able to (or can’t be bothered) to change the format of your existing fields.

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