# Date format ORA-01830

**URL:** <https://forum.inductiveautomation.com/t/date-format-ora-01830/76156>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [July 10, 2023, 7:20pm UTC](https://forum.inductiveautomation.com/t/date-format-ora-01830/76156 "2023-07-10T19:20:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [July 10, 2023, 7:20pm UTC](https://forum.inductiveautomation.com/t/date-format-ora-01830/76156/1 "2023-07-10T19:20:18Z")

</div>

I have updated my ignition from7.9.1 to 7.9.21 but I got an error in my query  
would you please help me

 ![query-error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f043d98a7137428ba88d40dcc20605619b047d43.jpeg)  
 ![query-error1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0ddb4f81145899ce2cae88a42d5996527a6b1709.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:** [July 10, 2023, 7:55pm UTC](https://forum.inductiveautomation.com/t/date-format-ora-01830/76156/2 "2023-07-10T19:55:51Z")

</div>

You probably need to stop using string conversions of your datetime values. Now that you've upgraded, you have named queries available, which can pass datetime values in DB native binary format. You should do so. (And get rid of all of the other string substitutions--they are not secure.)

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [July 10, 2023, 8:32pm UTC](https://forum.inductiveautomation.com/t/date-format-ora-01830/76156/3 "2023-07-10T20:32:51Z")

</div>

Thank you so much for the help, but right now I need to make it work and then I will change to the named query

this is an old design for another company, and I don't know how many things I need to change

I just now need help to keep going

I changed TO\_DATE to TO\_TIMESTAMP too but still the same error

---

<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:** [July 10, 2023, 8:39pm UTC](https://forum.inductiveautomation.com/t/date-format-ora-01830/76156/4 "2023-07-10T20:39:33Z")

</div>

You are string converting datetimes from java, and they appear to be including milliseconds. You are handing that string to Oracle to parse back into a timestamp, but your pattern doesn't have milliseconds. Fix the parsing pattern.

Or convert your datetimes to strings in separate custom properties that ensure you get a db-compatible date format. (You might be able to eliminate the explicity `to_date()` in your SQL.)
