# Report Grouping Based on Time Interval

**URL:** <https://forum.inductiveautomation.com/t/report-grouping-based-on-time-interval/9721>\
**Category:** Ignition\
**Created:** [February 17, 2015, 10:50pm UTC](https://forum.inductiveautomation.com/t/report-grouping-based-on-time-interval/9721 "2015-02-17T22:50:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samn265](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Samn265](https://forum.inductiveautomation.com/u/Samn265)\
**Post date:** [February 17, 2015, 10:50pm UTC](https://forum.inductiveautomation.com/t/report-grouping-based-on-time-interval/9721/1 "2015-02-17T22:50:34Z")

</div>

I am using Ignition 7.7.2

In the report designer how do you group data based on time interval? I would like to make selectable criteria based on the “DownTime Start” column, so I can say I need this date (or date range) and also this shift (or time range)

Attached are my report designer screenshot and the SQL Script for my data, and exported project.  
[DownTimeGrouping\_2015-02-17\_1620\_partial.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5e9baacbf193c5246d690ffd8565b4c987fa2288.proj) (73.5 KB)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/05dad578aea19fcdc3358f8be352072ec687a929.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bc051c714073f6c6603a119d5a6b1053f8d9d713.jpg)

---

<div class="post-metadata">

**Author:** ![CPowell](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@CPowell](https://forum.inductiveautomation.com/u/CPowell)\
**Post date:** [February 18, 2015, 9:53pm UTC](https://forum.inductiveautomation.com/t/report-grouping-based-on-time-interval/9721/2 "2015-02-18T21:53:58Z")

</div>

Try this:

Add this code to the SQL Query

```auto
,CONVERT(VARCHAR,(b.t_stamp - (convert(char(8),dateadd(ss, b.Uptime,0),108))),101) as StartDownTimegroup
```

I am just wanting to return the month/day/year so we can group that.

Then in the report designer, then add the new key ‘StartDownTimegroup’ to the grouping. Check Header. Make sure it is the top Grouping Key. Click the grey square next to it to add a top page icon. Here is a pic.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bba49d7decd716d833390f806f91b3213242f204.JPG)  

Also, here is a test report I made using an Audit log. So you can see how I am grouping the date and the action.

Let me know how that works.  
Cheers,  
Chris  
[Test Report.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/807efc63b026e1f9e9de357b49d17d1b2e407476.proj) (46.6 KB)

---

<div class="post-metadata">

**Author:** ![Samn265](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Samn265](https://forum.inductiveautomation.com/u/Samn265)\
**Post date:** [February 20, 2015, 11:07am UTC](https://forum.inductiveautomation.com/t/report-grouping-based-on-time-interval/9721/3 "2015-02-20T11:07:48Z")

</div>

Thank you Chris for taking the time and help me on this. It worked beautifully. You are awesome.
