Dataview incorrect this.ctime

Things I have tried

The following dataview query is displaying the incorrect process time

TABLE without id file.link as "Inbox", processTime AS "Waiting for..."
FROM "Notes/Fleeting Notes"

Process time is being given by
processTime::=round((date(now) - this.file.ctime).days,2) days
Which shows up correctly in the file, but not in the dataview query in the other file

How can I achieve the same thing where the query displays the correct number? I assume what is going wrong is that the this.file.ctime is being read by dataview as the file containing the query, rather than the file that is being queried.

What I’m trying to do

On my dashboard I have a dataview query showing all of my fleeting notes. I want to add a second column showing how long they have been waiting for me to process them

Doing inline fields in one file using a dataview query in one file, and trying to read that value from a query in another file like you seem to be doing, is just bound to cause race conditions and not function.

I think you’re better of, recalculating the process time in the latter query.

Try something like:

```dataview
TABLE without id file.link as "Inbox", processTime AS "Waiting for..."
FROM "Notes/Fleeting Notes"
FLATTEN round((date(now) - file.ctime).days, 2) + " days" as processTime
```
Bonus tip: How to present code properly in a forum post

If you want to showcase either markdown, or code blocks, or dataview queries properly in a forum post, be sure to add one line before and one life after what you want to present with four backticks, ````. This will ensure that any other backticks (like for code blocks) is properly shown.

1 Like

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