# Windows - Table - Calendar date filer - SQL query

**URL:** <https://forum.inductiveautomation.com/t/windows-table-calendar-date-filer-sql-query/14703>\
**Category:** Ignition\
**Created:** [July 6, 2017, 2:46pm UTC](https://forum.inductiveautomation.com/t/windows-table-calendar-date-filer-sql-query/14703 "2017-07-06T14:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dilan](https://avatars.discourse-cdn.com/v4/letter/d/ba8739/32.png) [@Dilan](https://forum.inductiveautomation.com/u/Dilan)\
**Post date:** [July 6, 2017, 2:46pm UTC](https://forum.inductiveautomation.com/t/windows-table-calendar-date-filer-sql-query/14703/1 "2017-07-06T14:46:17Z")

</div>

Hello

I’m trying to filer some data for a table. The reason I am using a table is the user wants to be able to download an excel document with the data.

I created a pop-up calendar called start\_date, and then a table and a button to save the table to excel. This work perfectly without the date filter.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/ac73b75402f06262ecc20133b051a353da3c726d.png)

When I then add the command: WHERE datetime \>= {Root Container.start\_date.date}  
I then get the error below:  
Exception: Error running query:  
SQLQuery(query=select \*  
From w00066  
WHERE datetime \>= 2017-06-06 16:41:40, database=watercare\_za)@0ms  
On: sg\_ck1\_all\_settlers (1).Root Container.Table.data  
caused by GatewayException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘16:41:40’ at line 2  
caused by MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘16:41:40’ at line 2

Ignition v7.9.1 (b2017012511)  
Java: Oracle Corporation 1.8.0\_121

---

<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 6, 2017, 3:35pm UTC](https://forum.inductiveautomation.com/t/windows-table-calendar-date-filer-sql-query/14703/2 "2017-07-06T15:35:04Z")

</div>

Parameter substitution (curly braces) within SQL bindings is purely a string concatenation. You need single quotes around your date parameters.

---

<div class="post-metadata">

**Author:** ![Dilan](https://avatars.discourse-cdn.com/v4/letter/d/ba8739/32.png) [@Dilan](https://forum.inductiveautomation.com/u/Dilan)\
**Post date:** [July 6, 2017, 4:46pm UTC](https://forum.inductiveautomation.com/t/windows-table-calendar-date-filer-sql-query/14703/3 "2017-07-06T16:46:30Z")

</div>

Hello Phil,  
Thank you so much, I thought I tried that, but I guess I was confusing myself.  
Using the WHERE datetime \>= ‘{Root Container.start\_date.date}’ worked perfectly.  
Thanks again!
