# Convert DateTime to integer

**URL:** <https://discuss.elastic.co/t/convert-datetime-to-integer/257924>\
**Category:** Kibana\
**Tags:** elastic-stack-sql, canvas, kql-kibana-query-language\
**Created:** [December 8, 2020, 12:03am UTC](https://discuss.elastic.co/t/convert-datetime-to-integer/257924 "2020-12-08T00:03:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [December 8, 2020, 2:15pm UTC](https://discuss.elastic.co/t/convert-datetime-to-integer/257924/3 "2020-12-08T14:15:05Z")

</div>

We have significant issues ordering our data table in the Canvas workpad accordingly to the timestamps.

I explain the full problem here: [Link](https://discuss.elastic.co/t/time-filter-is-not-working/258000)  
If this problem is solved then we are happy and we can continue our work.

In order to make the data table only present elements which lie between two dates, we thought to take these steps:

1. Adjust the ES SQL code so that the preview of the result is what we would like to get
2. We add an additional column so that timestamp1 and timestamp2 (timestamp1 \< timestamp2) are getting numbers which are number1\<number2
3. In the expression editor, we set 'filterColumn' to the column, which we created at step 2

We hope that you understand our request.  
We just want to filter our data table according to a given timespan.

With best regards

---

_[View the full topic](https://discuss.elastic.co/t/convert-datetime-to-integer/257924)._
