# fromMillis Error

**URL:** <https://forum.inductiveautomation.com/t/frommillis-error/33164>\
**Category:** Ignition Early Access\
**Created:** [March 17, 2020, 2:22pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164 "2020-03-17T14:22:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jramirez3](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jramirez3](https://forum.inductiveautomation.com/u/jramirez3)\
**Post date:** [March 17, 2020, 2:22pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/1 "2020-03-17T14:22:53Z")

</div>

I have a datetime value from sql server and I’m using the fromMillis() function. It’s throwing an error saying the value passed into the function is not a long type. I do a return type(value) transform on binding and it says PyLong is the type.

Anyone know the problem?

---

<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 17, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/2 "2020-03-17T14:26:52Z")

</div>

A PyLong is really a java BigInteger type, under the hood. Some (usually older) JDBC drivers don’t map this correctly. See if there is a newer JDBC driver available for your database.

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sunny/32/13319_2.png) [@Sunny](https://forum.inductiveautomation.com/u/Sunny)\
**Post date:** [March 17, 2020, 2:54pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/3 "2020-03-17T14:54:48Z")

</div>

Maybe try to force a type casting on your value : fromMillis(toDouble(value))

---

<div class="post-metadata">

**Author:** ![jramirez3](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jramirez3](https://forum.inductiveautomation.com/u/jramirez3)\
**Post date:** [March 17, 2020, 3:40pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/4 "2020-03-17T15:40:31Z")

</div>

I’ve updated the JDBC driver and tried the toDouble and still the same error.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 17, 2020, 3:42pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/5 "2020-03-17T15:42:04Z")

</div>

Can you post a screenshot of your binding/transform setup? There’s some potential avenues to see what’s going on here.

---

<div class="post-metadata">

**Author:** ![jramirez3](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jramirez3](https://forum.inductiveautomation.com/u/jramirez3)\
**Post date:** [March 17, 2020, 4:21pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/6 "2020-03-17T16:21:11Z")

</div>

expression transform

```auto
fromMillis({value})

```

The property binding is on a custom property key from a json named query binding. The database is MSSQL and the column type is datetime

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sunny/32/13319_2.png) [@Sunny](https://forum.inductiveautomation.com/u/Sunny)\
**Post date:** [March 17, 2020, 4:26pm UTC](https://forum.inductiveautomation.com/t/frommillis-error/33164/7 "2020-03-17T16:26:03Z")

</div>

Why don’t you use the Format transform:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b2109c8dff9481d8fcb8afe67d9d09abc97390db.png)
