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 need some help with executesql statements.

 

I am trying to compare a date in the Contracts table with a date stored in a global field in the BidR table.

 

I want to use executesql to get the date from the contracts table.

 

My statement is:

 

   ExecuteSql ( "SELECT estimatedawarddate_dt FROM contracts WHERE contracts.contractid_t = bidr.contractid_t";"";"")

 

The field "contractid_t" has the same value for both tables.  The returned value is"?" when the statement is executed.

 

Can anyone help with the syntax?

 

Also, how would I compare the date returned by sql with a filemaker date?

 

Thanks.

what is the field name of the global field in the

Bidr table?

My statement is:

 

ExecuteSql ( "SELECT estimatedawarddate_dt FROM contracts WHERE contracts.contractid_t = bidr.contractid_t";"";"")

 

Try

ExecuteSQL ( " 
  SELECT estimatedawarddate_dt 
  FROM contracts 
  WHERE contractid_t = ? 
  " ; "" ; "" ; bidr::contractid_t // this must be a field reference in FileMaker format, since it's a parameter of ExecuteSQL() 
)
Use the optional parameters, and the function will take care of any necessary type conversions, e.g. matching FM and SQL date formats, or implicitly quoting values when you query a text field.
  • Author

eos,

 

Thanks for your reply, your example helped me understand how to use an optional parameter, but I still get the same result..."?". 

 

I double checked the field data types, that they have actual dates in the fields, and the spelling of the table and field names.  It all seems syntactically correct.

 

I am not sure what else to check or do.

Wrap in EvaluationError() to see more details (error #)

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.