# Elastic SQL is not working with time bound data

**URL:** <https://discuss.elastic.co/t/elastic-sql-is-not-working-with-time-bound-data/207742>\
**Category:** Elasticsearch\
**Created:** [November 13, 2019, 4:14pm UTC](https://discuss.elastic.co/t/elastic-sql-is-not-working-with-time-bound-data/207742 "2019-11-13T16:14:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![farrukh\_aziz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/farrukh_aziz/32/55083_2.png) [@farrukh\_aziz](https://discuss.elastic.co/u/farrukh_aziz)\
**Post date:** [November 13, 2019, 4:14pm UTC](https://discuss.elastic.co/t/elastic-sql-is-not-working-with-time-bound-data/207742/1 "2019-11-13T16:14:23Z")

</div>

this search is working without time field how i can make it work with time bound.

POST \_sql?format=txt  
{  
"query":"SELECT network,usage.total from clients where usage.total \<= 1000 AND '@timestamp' \< now() - INTERVAL 7 MINUTE order by usage.total DESC"  
}

---

<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:** [November 14, 2019, 8:20am UTC](https://discuss.elastic.co/t/elastic-sql-is-not-working-with-time-bound-data/207742/2 "2019-11-14T08:20:47Z")

</div>

@farrukh_aziz I'm sorry, but I don't understand the question. Can you provide more details or ask the question differently?

Also, your query is slightly wrong. It should be `SELECT network,usage.total from clients where usage.total <= 1000 AND \"@timestamp\" < now() - INTERVAL 7 MINUTE order by usage.total DESC`. `@timestamp` should be surrounded by double quotes (not simple ones) and they should be escaped.

---

<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:** [December 12, 2019, 8:21am UTC](https://discuss.elastic.co/t/elastic-sql-is-not-working-with-time-bound-data/207742/3 "2019-12-12T08:21:02Z")

</div>

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