# Date/time filter on nested items

**URL:** <https://discuss.elastic.co/t/date-time-filter-on-nested-items/8549>\
**Category:** Elasticsearch\
**Created:** [July 28, 2012, 6:13am UTC](https://discuss.elastic.co/t/date-time-filter-on-nested-items/8549 "2012-07-28T06:13:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Alton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_alton/32/2795_2.png) [@Thomas\_Alton](https://discuss.elastic.co/u/Thomas_Alton)\
**Post date:** [July 28, 2012, 6:13am UTC](https://discuss.elastic.co/t/date-time-filter-on-nested-items/8549/1 "2012-07-28T06:13:30Z")

</div>

I'm trying to figure out how to do a query to find businesses that are open  
at a certain time in the day. For each business I have a nested list of  
"hours" that each contain the open and close hour for one day of the week.

I've put a simplified curl log at [https://gist.github.com/3192015](https://gist.github.com/3192015)

In that example, one business starts at 9AM, the other starts at 7AM one  
day and 8AM the other. My search attempts to filter it down to businesses  
with a start time before or at 8AM. However, both clinics are being  
returned.

Is this the right way to be trying this? Is there a better way?

Thanks,  
-Thomas

---

<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:** [July 6, 2017, 3:18am UTC](https://discuss.elastic.co/t/date-time-filter-on-nested-items/8549/2 "2017-07-06T03:18:42Z")

</div>


