Jump 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.

SELECT WHERE first letter lowercase followed by any upper case letter

Featured Replies

I'm using ExecuteSQL() to get a list of fields in a table. What I would like to do is be able to use my naming convention to include or exclude certain fields. For example I name certain utility field starting with a lower case "z" followed by an upper case letter as in Notes::zUtility. So I would like to exclude those fields from the list.

ExecuteSQL (

"
SELECT FieldName FROM FileMaker_Fields
WHERE TableName = ?
AND  FieldName NOT LIKE ?

"

; "" ; ""; "Notes" ; "z%" <-- this is not correct, what would this need to be to specify a lowercase z followed by any upper case letter? )

 

Any help would be greatly appreciated.

Thanks

Edited by Ron Cates

Hi Ron,

Off the top of my head, I'm guessing you'll need to hard code the "AND" portion 26 times, along the lines of...

ExecuteSQL (

"
SELECT FieldName FROM FileMaker_Fields
WHERE TableName = ?
AND  FieldName NOT LIKE ?
AND  FieldName NOT LIKE ?

"

; "" ; ""; "Notes" ; "zA%" ; "zB%" )   <=== keep going with "z%C", etc.

Perhaps someone else can suggest something more efficient?

Kevin

 

 

 

Edited by Kevin Frank

  • Author

Thought that might be the case. What about substituting those fields out after the ExecuteSQL(). would that be any easier? How would that look?

Substitute doesn't allow wild cards, so I don't see how that would work.

  • Author

Guess I'll just have to do it the hard way. Lol!

ExecuteSQL ( 

"
SELECT FieldName FROM FileMaker_Fields
WHERE TableName = ?
AND ( 

AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?
AND FieldName NOT LIKE ?

)
" 

; "" ; ""
; "Notes" ; "zA%" ; "zB%" ; "zC%" ; "zD%" ; "zE%" ; "zF%" ; "zG%" ; "zH%" ; "zI%" ; "zJ%" ; "zK%" ; "zL%" ; "zM%" ; "zN%" ; "zO%" ; "zP%" ; "zQ%" ; "zR%" ; "zS%" ; "zT%" ; "zU%" ; "zV%" ; "zW%" ; "zX%" ; "zY%" ; "zZ%" )

 

I don't find the parentheses to be necessary, but if you're going to use them, don't forget to remove the "AND" from the first "AND FieldName NOT LIKE ?"

(I know you know this, but for the benefit of any newbies who copy your code and wonder why it's not working.)

Edited by Kevin Frank

  • 4 weeks later...
  • Author

I did catch that. Probably should have edited the post...

Create an account or sign in to comment

Important Information

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

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.