August 9, 201312 yr I created a global called FIELD to hold a field name. I want to reference this global as the field name it should find and use it like this: ExecuteSQL( "SELECT id FROM customers WHERE field LIKE ? " ; "" ; "" ; "%NY%" ) I think I am confused. FIELD would hold the value of 'State' in this example. So I want it to look at the State field and find all NY states. How do I reference a global field which references a real field please? I have been reading bunches of examples and still can't figure this out. I changed the name of the post to hopefully explain.
August 9, 201312 yr Author And while here in case even this example doesn't help. I want same thing for the contains portion below in its variation spot. I want a a global field below as %VALUE%. to use to find the value in the field itself. I even tried GetFieldName to no avail. So I don't want to reference those global fields but rather the value inside them as the field I want to reference.
August 9, 201312 yr Solution The SQL statement is just a string of text that you can construct like any other text string in FileMaker, e.g.: "SELECT id FROM customers WHERE " & field & " LIKE ?"
August 9, 201312 yr Author oh wow. Sometimes it's the little things WHERE " & field & " LIKE ?" I was not leaving a space after the where and before the like. Thank you for the precise example which clearly showed my error.
Create an account or sign in to comment