# Specify Shift Hours for Tag Historian Data (Reporting)

**URL:** <https://forum.inductiveautomation.com/t/specify-shift-hours-for-tag-historian-data-reporting/93902>\
**Category:** Ignition\
**Tags:** ignition81, reporting\
**Created:** [July 30, 2024, 12:52pm UTC](https://forum.inductiveautomation.com/t/specify-shift-hours-for-tag-historian-data-reporting/93902 "2024-07-30T12:52:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Lee1](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Steven\_Lee1](https://forum.inductiveautomation.com/u/Steven_Lee1)\
**Post date:** [July 30, 2024, 12:52pm UTC](https://forum.inductiveautomation.com/t/specify-shift-hours-for-tag-historian-data-reporting/93902/1 "2024-07-30T12:52:14Z")

</div>

Hello.

I am using the tag historian.. duration on value to display machine downtime between my parameters {startdate} -7days and {enddate} now. However, I need to omit the duration if it is during offshift hours. How would I go about collecting the duration value only during when the shift is active over a 7 day period? (6PM - 6AM)

Thank you.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 30, 2024, 1:28pm UTC](https://forum.inductiveautomation.com/t/specify-shift-hours-for-tag-historian-data-reporting/93902/2 "2024-07-30T13:28:30Z")

</div>

Multiple queries. Typically an outer query that produces precise start and end timestamps for each shift, one row per shift. Then a nested historian query that references the outer row's timestamps to be its boundaries.

---

<div class="post-metadata">

**Author:** ![Steven\_Lee1](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Steven\_Lee1](https://forum.inductiveautomation.com/u/Steven_Lee1)\
**Post date:** [July 30, 2024, 1:41pm UTC](https://forum.inductiveautomation.com/t/specify-shift-hours-for-tag-historian-data-reporting/93902/3 "2024-07-30T13:41:23Z")

</div>

Hello

Can you please show this using an example?
