ExecuteSQL basics in FileMaker

Intermediate

FileMaker's ExecuteSQL function lets you query any table without a relationship. Learn the syntax, common patterns, and the most common pitfall: date and text quoting.

What you'll learn

  • The ExecuteSQL function signature and how to call it
  • How to pass field separators and correctly quote text vs dates
  • Common aggregate queries: COUNT, SUM, AVG

ExecuteSQL runs a SQL SELECT query against any table in your FileMaker file without requiring a relationship. It is powerful for reporting, cross-table lookups, and aggregations — but its date handling and quoting rules trip up almost every developer the first time.

1/4
1

The ExecuteSQL signature

ExecuteSQL ( sqlQuery ; fieldSeparator ; rowSeparator { ; arguments... } ) — the field and row separators define what goes between columns and rows in the result. Arguments (?) are used for parameterized values.

FileMaker Script
ExecuteSQL (
  "SELECT Name, Email FROM Customers WHERE Active = 1" ;
  "," ;  // field separator
  "¶"   // row separator (¶ = return character)
)

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo