# Database table query for reporting

**URL:** <https://forum.inductiveautomation.com/t/database-table-query-for-reporting/93352>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [July 17, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/database-table-query-for-reporting/93352 "2024-07-17T21:22:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bismark\_Aguocha](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@Bismark\_Aguocha](https://forum.inductiveautomation.com/u/Bismark_Aguocha)\
**Post date:** [July 17, 2024, 9:22pm UTC](https://forum.inductiveautomation.com/t/database-table-query-for-reporting/93352/1 "2024-07-17T21:22:56Z")

</div>

Hi #Ignition community👋🏾

I’m working on a personal project to learn more about the reporting module on ignition but i’m currently running into a slight issue .

Basically, I want to create a reporting data source that is a sql query of a db table but I want a way for that query to retrieve only the rows where the column t\_stamp is between the parameter {StartDate} and {EndDate}

So far i’m getting a parsing error because I think The datetime are not on the same format.

Has anyone had to query a specific range of a table for reporting? Any advice or insight would be greatly appreciated

---

<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 17, 2024, 9:25pm UTC](https://forum.inductiveautomation.com/t/database-table-query-for-reporting/93352/2 "2024-07-17T21:25:37Z")

</div>

Don't use curly brace substitutions with timestamps. Those are string conversion and substitution operations that are particularly unreliable with timestamps. Use a standard SQL query with `?` substitutions (unquoted). That will pass the timestamp to JDBC in binary form as a true datetime object.

---

<div class="post-metadata">

**Author:** ![Bismark\_Aguocha](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@Bismark\_Aguocha](https://forum.inductiveautomation.com/u/Bismark_Aguocha)\
**Post date:** [July 20, 2024, 10:13pm UTC](https://forum.inductiveautomation.com/t/database-table-query-for-reporting/93352/4 "2024-07-20T22:13:54Z")

</div>

Phil, You Are The G.O.A.T. This worked perfectly. Thank you .
