Help trying to display number of days project worked on and when completed

In short, what I’d like to do is set up a dataview table that shows how many days I’ve been working on a project (days from file creation date to the present day). But also, to only have projects “in process” (not completed) populate the table. Or, if possible, have a separate column indicate whether a project is in process or completed and if changed to completed, stop adding any more days so I know how long it took to complete.

I have a central note where I like to track my present projects, tasks, etc. I presently use the following dataview code block to help keep track of work memos:

TABLE Stage, dateformat(file.mtime, "dd.MM.yyyy") AS "Last Modified"
FROM !"➕ Extras"
WHERE Stage = "🚧"

(I keep my templates in the “:heavy_plus_sign: Extras” folder, hence omitting any files from that folder.)

My template for writing articles and/or memos presently uses the following YAML metadata:

Stage: ⚙️|🚧|🏆

The gear indicates it’s in the early research phase, the construction post is for when I get to the drafting phase, and the trophy signifies completion.

I’m open to adding some more items to YAML such as:

Start_Date: <%"YYYY-MM-DD") %>

But if it’s possible to do what I’d like to do without changing my template I would much prefer that.

Thank you in advance for any help.


  1. If you want to see both types (“:construction:” and “:trophy:”) and stop the account of days for completed projects, then you need to add a field as "Completion_Date:`
  2. If the creation date of the file is a valid date for your intents, then you don’t need to add a new field to start date. (but attention: if you use some kind of synchronization between devices I’m not sure if the creation date is a save date to use)
  3. To start check this query:
	dateformat(file.cday, "dd.MM.yyyy") AS "Creation",
	dateformat(file.mtime, "dd.MM.yyyy") AS "Last Modified",
	choice(Stage = "🚧", (date(today) - file.cday).days + " days", "**" + (default(Completion_Date, date(today)) -  file.cday).days + " days **") AS "Number of days",
	dateformat(Completion_Date, "dd.MM.yyyy") AS "Completion date"
FROM !"➕ Extras"
WHERE Stage = "🚧" OR Stage = "🏆"
SORT default(((x) => {🏆: 1, 🚧: 2}[x])(Stage), 3) ASC, file.cday ASC

Amazing, thank you so much!

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