Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4135 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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 ?"
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.