# T\_stamp report ignition not matching with parameters

**URL:** <https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [May 26, 2024, 6:56pm UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924 "2024-05-26T18:56:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesus\_Antonio\_Llanes](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Jesus\_Antonio\_Llanes](https://forum.inductiveautomation.com/u/Jesus_Antonio_Llanes)\
**Post date:** [May 26, 2024, 6:56pm UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924/1 "2024-05-26T18:56:50Z")

</div>

Hi, I'm currently trying to create a basic SQL query on reports using a MYSQL Database.

SELECT \* FROM group\_table  
WHERE t\_stamp \< '{EndDate}' ;

I've seen people commenting over this example on the forums but I haven't been able to solve it in my personal case.

When I tried the script above, Incorrect DATETIME value on '{EndDate}' appears.

If I take off the ' ' , SQL syntax error appears.

Currently I'm using transaction groups t\_stamp, created by ignition and the Default {StartDate} and {EndDate} provided by ignition report also. This on ignition 8.1.

When I solve this, im planning to change it to this next script:

SELECT \* FROM group\_table  
WHERE t\_stamp between '{StartDate}' AND '{EndDate}' ;

But first I need to make the date parameters work

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 26, 2024, 7:03pm UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924/2 "2024-05-26T19:03:53Z")

</div>

Is this a named query?  
What datatype is `EndDate`? (A datetime or a string?)

---

<div class="post-metadata">

**Author:** ![Jesus\_Antonio\_Llanes](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Jesus\_Antonio\_Llanes](https://forum.inductiveautomation.com/u/Jesus_Antonio_Llanes)\
**Post date:** [May 26, 2024, 7:06pm UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924/3 "2024-05-26T19:06:33Z")

</div>

Hi, no is a Basic SQL query on Data Source Reports section. I'm calling the t\_stamp value from the one that is created in a transaction group Database

---

<div class="post-metadata">

**Author:** ![Jesus\_Antonio\_Llanes](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Jesus\_Antonio\_Llanes](https://forum.inductiveautomation.com/u/Jesus_Antonio_Llanes)\
**Post date:** [May 26, 2024, 7:11pm UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924/4 "2024-05-26T19:11:15Z")

</div>

I've tried both date and string type. By default report creates it as a date type format. Ive pasted an example except, i'm using ignition 8.1  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/3/338a3e802fbde58e312246623d18312ab533de66.png)

---

<div class="post-metadata">

**Author:** ![Jesus\_Antonio\_Llanes](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Jesus\_Antonio\_Llanes](https://forum.inductiveautomation.com/u/Jesus_Antonio_Llanes)\
**Post date:** [May 26, 2024, 7:33pm UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924/5 "2024-05-26T19:33:32Z")

</div>

Even this example is on the ignition page, if I do it dicrectly on MYSQL benchwork it does work, but on the report it doesn´t

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/3/c30f489a00bb83b348760f919750598c5ff53c72.png)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [May 28, 2024, 6:09am UTC](https://forum.inductiveautomation.com/t/t-stamp-report-ignition-not-matching-with-parameters/90924/6 "2024-05-28T06:09:10Z")

</div>

I would suggest not using \< and \> with strings.  
The BETWEEN example should work fine with the basic query, but the \< operator likes to compare with a number not a string/datetime.  
In the database, the datetime is stored as a number, so it's likely that it is trying to compare a number to be less than a date, as no conversions are specified.
