Custom fields ad search criterias

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

Well if I understand you issue correctly, you can select the fields under Search>Search Criteria.

Hi gamer99,
Yes I can choose the serch criterias availables under Search>Search Criteria.
But when I must build my sql (and I must do it, the fields are added by me) how can I see wich search criteria did the user choose ?