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

Hello 

 

I'm in the process of redeveloping an FM11 solution in FM13.

I have a dream of only having one table occurrence per actual table in my FM13 update.

I have been happily doing all my lookups utilizing executeSQL until this evening when I attempted to building a simple select statement with a WHERE clause that included references to fields of type "TEXT"

I have tried inclosing the reference fields in " as suggested in many forum postings I have read but I still get the dreaded ? as the result.

 

Example 

 

$query = " SELECT code FROM Courses WHERE FM11PK = " & Sections::FK_course
the above example works as expected
 
$query = " SELECT code FROM Courses WHERE PK = "  & Sections::FK_courseFM13 
the above example returns the ?  
 
the only difference I can decipher is "PK" and "FK_courseFM13" are type TEXT where in the first example the two comparison fields are of type NUMBER
 
I have tried a couple other example in other tables using only reference fields of type TEXT and have no been able to get it to work - it must be a simple SYNTAX issue.
 
I'm heading to bed because I've been trying to figure this out all day - any help would be very appreciated.
Thanks
 
 
 
  • Author

Argh I think I got it - needed single quotes "'" around the Where Value.  :logik:

 

" SELECT code FROM Courses WHERE PK = '"  & Sections::FK_courseFM13 & "'"
 
works as expected!

Note that this problem could have been solved a different way, using the tools and recommended methods built into ExecuteSQL.

These provide for using a ? to represent placeholders for values to be used in the query. One advantage is the elimination of the need to manage single quotes.

 

http://www.filemaker.com/help/13/fmp/en/html/func_ref3.33.6.html

 

In your case it would be:

 

ExecuteSQL( "SELECT code FROM Courses WHERE PK = ?" ; ""; "" ; Sections::FK_courseFM13 )

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.