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

  • Newbies

I am relatively new to sql queries in Filemaker, and I'm receiving the ? in response to the following queries. Because I don't have the advanced version of FMP, I used Evaluate() to return the error code 8310 (syntax error). However I can't figure out where my syntax error is. Hopefully more experienced eyes will spot my problem(s).

The following is entered in a calculated field that returns text:

Let( [

$initials=ExecuteSQL("SELECT TaskAssignedTo FROM workflow WHERE" & Quote("_IDDocLog") & "=workflow::" & Quote("_IDDocLog") & "AND workflow::TaskNumber=9"; "" ; "" );

$name=ExecuteSQL ("SELECT FullName FROM staff WHERE AccountName= $initials"; "" ; "") ];

$name )

Thanks!!

 

Oops I meant to say that I used EvaluationError()

ExecuteSQL("SELECT TaskAssignedTo FROM workflow WHERE" & Quote("_IDDocLog") & "=workflow::" & Quote("_IDDocLog") & "AND workflow::TaskNumber=9"; "" ; "" );

This is a non functional SELECT statement. I cant even begin to guess what you are trying to accomplish.

You should look into using ? as variable value placeholders in SQL...i.e

ExecuteSQL ( "SELECT field FROM table WHERE field=? and WHERE field=?" ; "" ; "" ; value_for_first? ; value_for_second? )

Edited by Kris M

  • Author
  • Newbies

Thanks Kris M.

I replaced what I was using with your placeholder suggestion (below) but I'm still getting the 8310 error. One problem might be the underscores. But there may be other problems as well.

ExecuteSQL("SELECT TaskAssignedTo FROM workflow WHERE _IDDocLog=? AND workflow::TaskNumber=?"; "" ; "" ;  workflow::_IDDocLog ; 9);

What am I trying to accomplish? I have 2 tables, workflow (see attached file) and document. They are related by fields workflow::_IDDocLog and document::_IDDocLog. For one record in document, there are 16 related records in workflow. Each of the related records in workflow has a taskNumber, value incrementing from 1 to 16. I want to grab the value of workflow::TaskAssignedTo from the record in workflow with workflow::TaskNumber=9.

If there is a better way to do this than ExecuteSQL(), I'm all ears!

 

Screen Shot 2016-04-25 at 4.42.50 PM.png

  • Author
  • Newbies

I think I got this. The following works...

GetNthRecord(workflow::TaskAssignedTo ; 9)

Hi,

Try use "workflow._IDDocLog" (only one dot for all names of fields) and not workflow::_IDDocLog.

Yes underscores may be a problem at the begining of names

Have a good day

G

 

 

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.