# Number of hours in an interval of date

**URL:** <https://discuss.elastic.co/t/number-of-hours-in-an-interval-of-date/249683>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [September 23, 2020, 4:11pm UTC](https://discuss.elastic.co/t/number-of-hours-in-an-interval-of-date/249683 "2020-09-23T16:11:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![haythem](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@haythem](https://discuss.elastic.co/u/haythem)\
**Post date:** [September 23, 2020, 4:11pm UTC](https://discuss.elastic.co/t/number-of-hours-in-an-interval-of-date/249683/1 "2020-09-23T16:11:03Z")

</div>

Hi guys , i want to create it a scripted field where i count the number of hours in an interval of date when the sum of the number of transactions is below a certain value,  
my fields are : nbre\_of\_transaction , date  
any idea how to do it ?  
ELK 7.4.0  
thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 21, 2020, 4:11pm UTC](https://discuss.elastic.co/t/number-of-hours-in-an-interval-of-date/249683/2 "2020-10-21T16:11:17Z")

</div>

Closed on October 21, 2020, 4:11pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
