Find answers, ask questions, and connect with our community of business solutions and app users, developers, and partners.
Here is a really neat FileMaker SQL Script Tool and demo file from Tim Dietrich…Have you ever performed a find in FileMaker and wondered what an equivalent SELECT statement would look like? Or maybe had the need to write a SELECT statement (for use with ExecuteSQL), and you knew how to perform the find, but weren’t sure how to translate it into SQL?
To help with this, I’ve put together a script called “SELECT Builder.” To use it, you simply add it to your database, perform a find, and run the script. When the script completes, it will display a SELECT statement that is equivalent to the find that you performed. It also puts the SELECT statement into a global variable, so that you can grab the SQL and use it in an ExecuteSQL call.
Here’s a link to a very simple database that includes the SELECT Builder script:
I’ve included 500 sample records to help you experiment with it. (Don’t worry, they’re fake.)
To experiment with the script, open the database, perform a find as you normally would, and then run the script. If you want to use the script in your own database, copy it from the demo database. The script uses variables only (no fields), so it should work without needing to make any modifications to it. Be sure to read the script header comment, which includes notes and a few “gotchas” that you should be aware of.
I hope you find the script to be useful. Let me know what you think.