Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Field name inside of field?

Featured Replies

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.

Solved by Fitch

Go to solution
  • 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.

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

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.