# Select data based on timestamp

**URL:** https://discuss.elastic.co/t/select-data-based-on-timestamp/335496
**Category:** Kibana
**Created:** [June 8, 2023, 5:19am UTC](https://discuss.elastic.co/t/select-data-based-on-timestamp/335496 "2023-06-08T05:19:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![laurijssen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurijssen/32/117021_2.png) [@laurijssen](https://discuss.elastic.co/u/laurijssen)
#### Post date: [June 8, 2023, 5:19am UTC](https://discuss.elastic.co/t/select-data-based-on-timestamp/335496/1 "2023-06-08T05:19:26Z")

</div>

Im trying to select data in a timestamp range (plus somie more criteria:

@timestamp: ["2023-06-07T:07:00:00" TO "2023-06-07T09:00:00"]

but this gives the error:

Expected AND, OR, end of input, whitespace but """ found. @timestamp: ["2023-06-07T:07:00:00" TO "2023-06-07T09:00:00"]

How do I select time ranges in KQL?

---

<div class="post-metadata">

### Author: ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)
#### Post date: [June 8, 2023, 9:22am UTC](https://discuss.elastic.co/t/select-data-based-on-timestamp/335496/2 "2023-06-08T09:22:34Z")

</div>

@timestamp \> now-3d AND @timestamp \< now-2d

---

<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, 2023, 9:23am UTC](https://discuss.elastic.co/t/select-data-based-on-timestamp/335496/3 "2023-07-06T09:23:05Z")

</div>

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