# Query tag history data

**URL:** <https://forum.inductiveautomation.com/t/query-tag-history-data/11424>\
**Category:** Ignition\
**Created:** [March 28, 2016, 1:42pm UTC](https://forum.inductiveautomation.com/t/query-tag-history-data/11424 "2016-03-28T13:42:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_newb](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@the\_newb](https://forum.inductiveautomation.com/u/the_newb)\
**Post date:** [March 28, 2016, 1:42pm UTC](https://forum.inductiveautomation.com/t/query-tag-history-data/11424/1 "2016-03-28T13:42:11Z")

</div>

Hi,

I would like to query tag history data in the database, using a where clause in the query that looks at the timestamp.

It looks like the timestamp is stored as data type bigint… i have a calendar on a vision screen that I want to use to use to get the date, but I can’t type cast it into a big int.

Is there another way I can convert a data type ‘date’ to something I can use in my where clause?

Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 28, 2016, 3:26pm UTC](https://forum.inductiveautomation.com/t/query-tag-history-data/11424/2 "2016-03-28T15:26:57Z")

</div>

Variations of this will do. The bigint column in the history tables is unix timestamp milliseconds.`from java.util import Date
now = Date()
bigint = now.getTime()`
