AnsweredAssumed Answered

ExecuteSQL ok in Data Viewer but not in Calculated Field

Question asked by CristosLianides-Chin on Dec 5, 2014
Latest reply on Dec 5, 2014 by CristosLianides-Chin

Title

ExecuteSQL ok in Data Viewer but not in Calculated Field

Post

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:

Let ([
    ~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.

Relevant screenshots:

http://snag.gy/COG6G.jpg

http://snag.gy/98PNg.jpg

Outcomes