ExecuteSQL ok in Data Viewer but not in Calculated Field
I'm trying to use an ExecuteSQL statement to perform a COUNT without needing to create unnecessary relationships. Although the calculation works perfectly when run in the Data Viewer, I only get a "?" when creating it in a calculated field. Any suggestions?
Here's the calculation:
~sqlQuery = "SELECT COUNT(xRequest) FROM HS_REQUEST WHERE fOpen=1 AND xStatus=? AND xPersonAssignedTo=?"
ExecuteSQL ( ~sqlQuery ; "" ; "" ; "19"; hsID)
NOTE: The table referenced is an external SQL table, not a FileMaker table.