# Calculating the time spent

**URL:** <https://community.glideapps.com/t/calculating-the-time-spent/79445>\
**Category:** Ask for Help\
**Created:** [January 23, 2025, 1:20pm UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445 "2025-01-23T13:20:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![studalov](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@studalov](https://community.glideapps.com/u/studalov)\
**Post date:** [January 23, 2025, 1:20pm UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445/1 "2025-01-23T13:20:55Z")

</div>

Hello everyone. How to calculate the time spent on work in Glide. Let’s say work starts at 8:20, the first task will take 1:20, the second task 2:15 minutes, the third task 1:55 minutes. The purpose of the table is to calculate the time of task completion. For example, task 1 at 9:40, task 2 at 11:55, task 3 at 13:50.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 23, 2025, 2:16pm UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445/2 "2025-01-23T14:16:32Z")

</div>

If you record a start and end datetime, you can use a math column to calculate the difference. Then you can use a relation to link similar tasks together and a rollup to sum the total time.

---

<div class="post-metadata">

**Author:** ![studalov](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@studalov](https://community.glideapps.com/u/studalov)\
**Post date:** [January 23, 2025, 3:47pm UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445/3 "2025-01-23T15:47:53Z")

</div>

Thanks for the answer. I got a table with time calculation for each task. But by what principle should I combine tasks to calculate the finish of each task?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 24, 2025, 12:58am UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445/4 "2025-01-24T00:58:28Z")

</div>

If you have a parent level of those tasks, I think you can do it like this.

#### 1. **Projects Table**

- Have a table named **Projects**.
- Add a RowID column.
- Add a column `Initial Start Time` (use **Date & Time** type).

#### 2. **Tasks Table**

- Create a table named **Tasks**.
- Add columns:
  - `Task Name` (Text)
  - `Duration` (Number, in minutes)
  - `Order` (Number, to define task sequence)
  - `Project ID` (Related to the **Projects** table).
  - `Project Relation` (Relate the Project ID to the RowID in the Projects table).
  - `Project Initial Start` (Lookup the project’s initial start time from the relation, single match).

#### 3. **Self-Query for Previous Tasks**

- Create a query in the **Tasks** table named `Previous Tasks`:
  - Condition: `Project ID equals to Current row > Project ID`  
`AND Order < Current row > Order`.

#### 4. **Calculate Previous Durations Sum**

- Add a column `Previous Durations Sum` (Rollup):
  - Source: `Previous Tasks` query.
  - Aggregation: **Sum** of the `Duration` field.

#### 5. **Calculate Start Time**

- Add a column `Start Time` (Math):

`Project's Initial Start Time` + `Previous Durations Sum`

1. **Calculate End Time**

- Add a column `End Time` (Math):

`Start Time` + `Duration (in minutes)`/60/24

---

<div class="post-metadata">

**Author:** ![studalov](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@studalov](https://community.glideapps.com/u/studalov)\
**Post date:** [January 25, 2025, 5:14pm UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445/5 "2025-01-25T17:14:49Z")

</div>

Many thanks to you my friend

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 25, 2025, 11:51pm UTC](https://community.glideapps.com/t/calculating-the-time-spent/79445/6 "2025-01-25T23:51:15Z")

</div>

My pleasure to help!
