# Use the date from range query in painless script

**URL:** <https://discuss.elastic.co/t/use-the-date-from-range-query-in-painless-script/141321>\
**Category:** Elasticsearch\
**Created:** [July 24, 2018, 7:54am UTC](https://discuss.elastic.co/t/use-the-date-from-range-query-in-painless-script/141321 "2018-07-24T07:54:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bartors](https://avatars.discourse-cdn.com/v4/letter/b/50afbb/32.png) [@Bartors](https://discuss.elastic.co/u/Bartors)\
**Post date:** [July 24, 2018, 7:54am UTC](https://discuss.elastic.co/t/use-the-date-from-range-query-in-painless-script/141321/1 "2018-07-24T07:54:30Z")

</div>

Hello.  
I am trying to use Scripted Metric Aggregation to perform some analysis on my data set.  
The end user will be using a ranged query and I need to be able to import the date (gte and lt values) into a script param. Is it any way of doing it?

---

<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:** [August 21, 2018, 7:54am UTC](https://discuss.elastic.co/t/use-the-date-from-range-query-in-painless-script/141321/2 "2018-08-21T07:54:33Z")

</div>

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