# Include both time bounds in group by time(1h) in Influxdb

**URL:** <https://community.influxdata.com/t/include-both-time-bounds-in-group-by-time-1h-in-influxdb/16827>\
**Category:** Systems\
**Tags:** influxdb, telegraf, time-series, influxql, flux\
**Created:** [November 19, 2020, 11:26am UTC](https://community.influxdata.com/t/include-both-time-bounds-in-group-by-time-1h-in-influxdb/16827 "2020-11-19T11:26:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravikant\_Gautam](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/ravikant_gautam/32/5700_2.png) [@Ravikant\_Gautam](https://community.influxdata.com/u/Ravikant_Gautam)\
**Post date:** [November 19, 2020, 11:26am UTC](https://community.influxdata.com/t/include-both-time-bounds-in-group-by-time-1h-in-influxdb/16827/1 "2020-11-19T11:26:43Z")

</div>

I am trying to implement group by time(1h) and it’s working fine. Suppose for 2:00 o’clock I used group by method then it starts taking interval from 1:00 to 1:59 and 3:00 it starts from 2:00 to 2:59. Now I want to implement a method that takes both bound of the time. 1:00 and 2:00 for 2:00 timestamp and 3:00 take 2:00 and 3:00.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [November 24, 2020, 8:26pm UTC](https://community.influxdata.com/t/include-both-time-bounds-in-group-by-time-1h-in-influxdb/16827/2 "2020-11-24T20:26:31Z")

</div>

Hello @Ravikant_Gautam,  
Can you try grouping by the equivalent minutes instead?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [November 24, 2020, 8:28pm UTC](https://community.influxdata.com/t/include-both-time-bounds-in-group-by-time-1h-in-influxdb/16827/3 "2020-11-24T20:28:06Z")

</div>

Also, may I ask what your end goal is? Why do you want to group by 1hr + 1min? and then overlap the grouping the next hour? Am I missing something?

---

<div class="post-metadata">

**Author:** ![Ravikant\_Gautam](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/ravikant_gautam/32/5700_2.png) [@Ravikant\_Gautam](https://community.influxdata.com/u/Ravikant_Gautam)\
**Post date:** [November 25, 2020, 5:07am UTC](https://community.influxdata.com/t/include-both-time-bounds-in-group-by-time-1h-in-influxdb/16827/4 "2020-11-25T05:07:29Z")

</div>

Actually, I am getting data at 15 mins interval  
01:00:00  
01:15:00  
01:30:00  
01:45:00  
02:00:00  
So, I want to use group by for one hour including 01:00:00 and 02:00:00 timestamp and save under the timestamp 01:00:00.
