# Database pens on EasyChart - t\_stamp is not a date error

**URL:** <https://forum.inductiveautomation.com/t/database-pens-on-easychart-t-stamp-is-not-a-date-error/45356>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 7, 2021, 6:37pm UTC](https://forum.inductiveautomation.com/t/database-pens-on-easychart-t-stamp-is-not-a-date-error/45356 "2021-04-07T18:37:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![esteban.brenes](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@esteban.brenes](https://forum.inductiveautomation.com/u/esteban.brenes)\
**Post date:** [April 7, 2021, 6:37pm UTC](https://forum.inductiveautomation.com/t/database-pens-on-easychart-t-stamp-is-not-a-date-error/45356/1 "2021-04-07T18:37:31Z")

</div>

Software:  
Ignition 8.1.4  
SQL Server 2008 R2

Issue:  
When adding DataBase pens on an EasyChart in Vision I get the error shown. Also, you can see the data table and the data table configuration I’m trying to read. Seems that I’m looking for a datetime data type, but the only column in that table with that data type is datetime, but its data is null.  
Is there a way to have my EasyChart running with that t\_stamp data? do I need to program something else to format that column or to have data on my datetime column?

Every little help is well appreciated

 ![EasyChart Customizer](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/273f9e5995da5ba3b74c183a60e76f7f53a1ca74.jpeg)  
 ![Database](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0ca8b690e71f9f79222b97cf5ea1d4e92676a25a.jpeg) ![Table Design](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/507583a2f36f15893b28866ba038dace04e6c0a2.jpeg)

---

<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:** [April 7, 2021, 7:19pm UTC](https://forum.inductiveautomation.com/t/database-pens-on-easychart-t-stamp-is-not-a-date-error/45356/2 "2021-04-07T19:19:15Z")

</div>

The tag historian doesn’t use a date/time datatype for t\_stamp. For maximum cross-brand DB compatibility, it uses a long integer holding UTC milliseconds. You’ll need a view that converts it back to a date.

Or just use a tag historian pen for tag historian data.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 7, 2021, 8:46pm UTC](https://forum.inductiveautomation.com/t/database-pens-on-easychart-t-stamp-is-not-a-date-error/45356/3 "2021-04-07T20:46:20Z")

</div>

I ran into this with reports, but with MySQL. I think what you need is something like in the view you create:

SELECT DATEADD(MILLISECOND, t\_stamp % 1000, DATEADD(SECOND, t\_stamp / 1000, ‘19700101’)) as dateTimeStamp

I don’t have a mssql database to test on, may need some tweaking.
