Days since a note has been created?

What I’m trying to do

In my obsidian dataview using a table, I am trying to include a new column which tells me the days it has been that a note has been created, is there a way to do a calculation/manupulate one of the inline queries to display this information, I know I have seen the below… but I want do have whole days e.g Days since: 8 so it is easier to track

existsSince:: = date(now) - this.file.ctime

LIST existsSince
WHERE existsSince

Things I have tried

Just asked the forum!

existsSince:: `= (date(today) - date(this.file.cday)).days`
2 Likes

Thank you this worked perfectly!

Do note that the code excerpts above sets the inline field of existsSince to the query, not the result of the query. This means that if you use this field in other contexts you may or may not very the actual result you want.

In most cases, if you want the result in another query you’re better of doing this existence query directly within the other query, if that make sense.

1 Like

Thanks! How would I update the existing to capture the results of the query from the below?

existsSince:: = (date(today) - date(this.file.cday)).days

You mean how to query for example the existence of file A from another file?

Have managed to fix! all good thank you

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