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

Here is what I need.  I have global field called gColorized.  How would I write this, please?

Select ProductNumber from Products where ProductDescription contains value in Globals::gColorized or where Refactor contains value in gColorized

Everything I've tried, I only get ?

Thank you for helping.  SQL does not like me yet.

Well, I am posting to have fun, which puzzle solving is …

So relax a little, and try

ExecuteSQL ( "
  SELECT ProductNumber
  FROM Products
  WHERE ProductDescription LIKE '%" & Globals::gColorized & "%' OR Refactor LIKE '%" & Globals::gColorized & "%'
  " ; "" ; ""
)

which thanks to LIKE and the % placeholder works like PatternCount(), i.e. matches on substrings; depending on your need, you may want to work with Lower() or Upper() (same function names in both FM and SQL) to find case-insensitive matches

Note that you cannot use FM syntax in/as SQL references; i.e. a fully qualified field name in FM is TableName::fieldName, but in SQL its TableName.fieldname.
But as long as the table reference is unambiguous (which in simple queries it usually is), you don't have to use that form anyway.

Since you have Advanced, you could also put the Data Viewer to good use and try

Let (
  sql =
  "SELECT ProductNumber 
  FROM Products
  WHERE ProductDescription LIKE '%" & Globals::gColorized & "%' OR Refactor = '%" & Globals::gColorized & "%'
  " ;
  Execute ( sql ; "" ; "" ) // sql ; switch commented expressions, i.e. use sql // Execute ( sql ; "" ; "" ), to quickly see and examine the literal sql string (and spot errors)

)

to aid in debugging.

 

Edited by eos

  • Author

Okay I have mellowed. :D

Thank you for helping me Eos.  This is exactly what I needed.  and the tip on data viewer with SQL helps also.

 

Edited by Charity

This is exactly what I needed.​

Good to hear… :D

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.