# How We Calculate Time on Task, the Business Hours Between Two Dates

**URL:** https://discourse.getdbt.com/t/how-we-calculate-time-on-task-the-business-hours-between-two-dates/6680
**Category:** In-Depth Discussions
**Tags:** devblog
**Created:** [February 8, 2023, 5:06pm UTC](https://discourse.getdbt.com/t/how-we-calculate-time-on-task-the-business-hours-between-two-dates/6680 "2023-02-08T17:06:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)
#### Post date: [February 8, 2023, 5:06pm UTC](https://discourse.getdbt.com/t/how-we-calculate-time-on-task-the-business-hours-between-two-dates/6680/1 "2023-02-08T17:06:30Z")

</div>

This is a companion discussion topic for the original entry at [How We Calculate Time on Task, the Business Hours Between Two Dates | dbt Developer Blog](https://docs.getdbt.com/blog/measuring-business-hours-sql-time-on-task)

---

<div class="post-metadata">

### Author: ![Hastings](https://avatars.discourse-cdn.com/v4/letter/h/ee7513/32.png) [@Hastings](https://discourse.getdbt.com/u/Hastings)
#### Post date: [May 31, 2023, 4:04pm UTC](https://discourse.getdbt.com/t/how-we-calculate-time-on-task-the-business-hours-between-two-dates/6680/2 "2023-05-31T16:04:12Z")

</div>

Thanks for the incredibly helpful article and repo! I have an interesting issue I’m running into. When I create the ‘attempt-2-subquery’ macro, I am unable to change the names of either macros and have it run successfully in any model. ie. If I keep the names the same as you have defined them (working\_min\_between, business\_minutes\_between\_\_2) dbt is able to locate the macro and run it. However if I change the names to something like ‘working\_minutes’ and ‘business\_minutes\_final’, dbt can’t find the macros under those names. I haven’t run into any issues like this in naming macros before. Do you have a possible explanation on why this is happening?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)
#### Post date: [May 31, 2023, 4:04pm UTC](https://discourse.getdbt.com/t/how-we-calculate-time-on-task-the-business-hours-between-two-dates/6680/3 "2023-05-31T16:04:12Z")

</div>


