# Histogram and calendar\_interval

**URL:** <https://discuss.elastic.co/t/histogram-and-calendar-interval/196407>\
**Category:** Elasticsearch\
**Created:** [August 22, 2019, 9:05pm UTC](https://discuss.elastic.co/t/histogram-and-calendar-interval/196407 "2019-08-22T21:05:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [August 22, 2019, 9:05pm UTC](https://discuss.elastic.co/t/histogram-and-calendar-interval/196407/1 "2019-08-22T21:05:02Z")

</div>

I have sql with histogram and interval  
now after upgrade to 7.x it complains that it will be deprecated.

select histogram(status\_achieved, INTERVAL 1 day) as d

but when I type  
select histogram(status\_achieved, FIXED\_INTERVAL 1 day) as h  
or  
select histogram(status\_achieved, CALANDER\_INTERVAL 1 day) as h

it fails with errors. what would be the correct syntax. can't find it anywhere.

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [August 23, 2019, 7:08am UTC](https://discuss.elastic.co/t/histogram-and-calendar-interval/196407/2 "2019-08-23T07:08:50Z")

</div>

@elasticforme the deprecation message being displayed issue has been fixed in this PR: [https://github.com/elastic/elasticsearch/pull/45501](https://github.com/elastic/elasticsearch/pull/45501). The fix should be available in 7.2.2 and 7.3.1.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [August 23, 2019, 12:55pm UTC](https://discuss.elastic.co/t/histogram-and-calendar-interval/196407/3 "2019-08-23T12:55:52Z")

</div>

yes that I know.  
I am already using 7.2.0  
and want to use calander\_interval but does not work.

I guess I will give it try on 7.3.2 test machine that I have

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [August 23, 2019, 1:30pm UTC](https://discuss.elastic.co/t/histogram-and-calendar-interval/196407/4 "2019-08-23T13:30:24Z")

</div>

Yes, you cannot decide which type of interval to use. HISTOGRAM always uses `fixed_interval` and it's not configurable because SQL doesn't have a notion of configurable histograms.

---

<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:** [September 20, 2019, 1:30pm UTC](https://discuss.elastic.co/t/histogram-and-calendar-interval/196407/5 "2019-09-20T13:30:26Z")

</div>

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