Hi,
I have a table with the following fields:
- id
- name
etc.
To allow my customer to do a search like this:
SELECT id, name FROM table WHERE name = ‘name1’ or name = ‘name2’
I created a grid, added 2 fields (name1 and name2) to the search fields and composed the sql on the OnScriptInit event with the sc_select_where(add) macro.
All fine.
But now my customer want to decide the search criteria, (equal, contains, not equal) and I can’t understand how to check it for a field I added.
So he want something like this:
SELECT id, name FROM table WHERE name = ‘name1’ or name LIKE ‘%name2%’
How can I build the sql checking the search criteria choosen by my customer for field I added ?
Thanx