# dateRange problem

**URL:** <https://forum.inductiveautomation.com/t/daterange-problem/30630>\
**Category:** Ignition\
**Created:** [December 11, 2019, 8:40pm UTC](https://forum.inductiveautomation.com/t/daterange-problem/30630 "2019-12-11T20:40:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom.ha](https://avatars.discourse-cdn.com/v4/letter/t/8491ac/32.png) [@tom.ha](https://forum.inductiveautomation.com/u/tom.ha)\
**Post date:** [December 11, 2019, 8:40pm UTC](https://forum.inductiveautomation.com/t/daterange-problem/30630/1 "2019-12-11T20:40:36Z")

</div>

I write Sql:

SELECT `Hum`,`Temp`,`Pressure`,`t_stamp`  
FROM table  
Where t\_stamp \>= ‘{StartDate}’ AND  
t\_stamp \<= ‘{EndDate}’

Problem is  
WARN: Simple Query could not be completedIncorrect DATETIME value: ‘Wed Dec 11 07:39:56 EST 2019’

How to fixed it. Thank you very much

---

<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:** [December 12, 2019, 2:05pm UTC](https://forum.inductiveautomation.com/t/daterange-problem/30630/2 "2019-12-12T14:05:19Z")

</div>

Curly braces in Ignition’s queries just do a string substitution, using the default string conversion for whatever is inside the curly braces. Use a named query to pass complex types like dates directly to the DB via JDBC parameters. This avoids the string conversion. The reporting module also allows ‘?’ substitution (like the system.db._Prep_() script functions) which also pass parameters without converting to strings.

If you cannot avoid the string substitution, you will have to convert the dates to strings yourself in a format your database likes. This varies by database brand.
