First of all if you have them as just lines, you’ll have to process the content of the entire file, so I would strongly suggest to go for a list/task style for recording these values. This will allow for dataview to pick up the lines a lot easier:
- [a] 12:08:29 15:38:37 Processed boxes [[:construction: Project (2022-2023)]] [[:mountain: Development]]
- [a] 15:55:59 15:57:26 Emailed Newsletter [[:construction: Historical Society History]] [[:mountain: Archive]]
Here I’ve used a decorated task, and in my test vault the [a]
-tasks shows as:
This allows for using TASK queries from dataview to query the information. Before going there, I would also point out that just a timestamp isn’t recognised by Dataview as a proper date, since the date part is missing. So one trick related to that is to prepend any date to the front of the timestamp to make it into a proper date, which can then be used for duration calculations.
Another caveat related to Dataview is that it’s not a problem to use a query within your daily note to produce the time spent on any given project. However, to re-use the result value from that query another place isn’t as easy. In fact, it’s easier to just reproduce the query in that other place. In other words, use the same query in both the daily note and the weekly/monthly/project note, and just vary the limitations of the query related to where it picks it values from.
So with this being said here is the link to two of my earlier responses related to similar cases, which hopefully you can utilise to build a query for your need:
For a purer solution using only dataviewjs, see the next thread response by AlanG: