AnsweredAssumed Answered

ExecuteSQL Function Syntax

Question asked by fmdataweb on Sep 13, 2016
Latest reply on Sep 13, 2016 by beverly

I have a simple ExecuteSQL query that's working well which I need to extend and I'm not sure how what the correct syntax is - nothing I've tried so far has worked.


Here's my current query:


ExecuteSQL ( "SELECT " & GetSQLFieldName ( Logs::ActivityDate ) & " FROM Logs WHERE " & GetSQLFieldName ( Logs::_StaffID ) & " = ? AND " & GetSQLFieldName ( Logs::_TemplateID ) & " = ? ORDER BY ActivityDate DESC" ; "" ; "" ; Staff::_StaffID ; "ST155"  )


This returns 1 or more dates that show when the last Template with a Template ID of ST155 was sent to a particular staff member - this is working well. I now need to extend this to include results for a 2nd Template ID (ST963) - so I'm after all records for the Staff where the Template ID is either ST155 or ST963.


In a FileMaker find I would do a multiple request for each Template ID but not sure how to do this with ExecuteSQL - have tried to use an OR operator but just getting a ? at the moment.


Appreciate it if someone could show me the syntax to use here.