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.

Featured Replies

I wasn't sure if to start a new topic or to mention this here. So forgive me if this is not the place.

I am not that familiar with MySQL but, I was playing around with the ExecuteSQL () Function in order to find all records that matched a certain criteria. I came up with this:

ExecuteSQL ( "

SELECT fullName

FROM people

WHERE fullName LIKE '%" & GLOBAL::SEARCH & "%' " ; " ; " ; ¶)

This would return the names of people that match the text entered in a global field called Search. If the value in the search field was "Alex" it would return Alexis, Alexander. However if the value was "alex" (the letter A in lowercase) it would not return Alexis nor Alexander.

Is this normal MySQL behavior? If so, is there a way to make my search not be case sensitive.

I found that the following works, but I am wondering if there is a more elegant or correct way of doing this.

ExecuteSQL (

"SELECT fullName

FROM people

WHERE LOWER(fullName) LIKE '%" & Lower ( GLOBAL::SEARCH ) & "%' " ; " ; " ; ¶)

This has nothing to do with MySQL which is a different database program. You are making an SQL query in FMP, The code you show:

ExecuteSQL (

"SELECT fullName

FROM people

WHERE LOWER(fullName) LIKE '%" & Lower ( GLOBAL::SEARCH ) & "%' " ; " ; " ; ¶)

will find every name that contains whatever is in GLOBAL::SEARCH. I don't think that is what you want. You have a wildcard before and after GLOBAL::SEARCH.

I would change the where clause to: WHERE fullName LIKE '%" & Upper ( GLOBAL::SEARCH ) & "%' " This will find all first and last names that start with GLOBAL::SEARCH. Leave out the first % and you will get first names that start with GLOBAL::SEARCH. If you only want last names then use lastName in the Where clause.

Look at FQL heading for more on using SQL in FMP. Kevin Frank's SQL Sandbox is a useful learning tool and included some custom functions for working with SQL in FMP/

Edited by Lee Smith

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.