Hi, I trying to modify a sql query I found in the “ignition demo project” I have a table with this code:
[code]SELECT * FROM inventory
{Root Container.option.WhereClause}
[/code]
I have the where clause in a custom property in a container named option, the expression is this:
[code]“WHERE lastUpdated >= '” + {Root Container.option.Popup Calendar.date} +
“’ AND lastUpdated <= '”+ {Root Container.option.Popup Calendar 1.date} + "’ "+
if(len({Root Container.option.Search Field.text}) > 0,
“AND (name LIKE '%” + {Root Container.option.Search Field.text}
+"%’ OR description LIKE ‘%" + {Root Container.option.Search Field.text}
+"%’) ",
“”) +
if({Root Container.option.Dropdown.selectedLabel} != “Any”,
“AND location=’” + {Root Container.option.Dropdown.selectedLabel} + “’ “,””)[/code]
this code works and filters a table if there is a date selected or if there is something in the Search field, but [color=#FF0000]I want to remove de date condition[/color] but I getting errors, I have this when I remove the date condition:
[code]"WHERE "+
if(len({Root Container.option.Search Field.text}) > 0,
“(name LIKE '%” + {Root Container.option.Search Field.text}
+"%’ OR description LIKE ‘%" + {Root Container.option.Search Field.text}
+"%’) ",
“”) +
if({Root Container.option.Dropdown.selectedLabel} != “Any”,
“AND location=’” + {Root Container.option.Dropdown.selectedLabel} + “’ “,””)[/code]
I think there is some quotes “” I need to clear but I can’t find the problem, please help me.