Charity Posted August 9, 2013 Posted August 9, 2013 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.
Charity Posted August 9, 2013 Author Posted August 9, 2013 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.
Fitch Posted August 9, 2013 Posted August 9, 2013 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 ?"
Charity Posted August 9, 2013 Author Posted August 9, 2013 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.
Recommended Posts
This topic is 4135 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now