The repository, WF and LF servers are all on the same VM (LF and WF 9.1.1 on Server 2012 R2). The queried database is on a different SQL server, on a different VM. There are no known authentication issues.
This is the query, which I copied exactly from the Manage Metadata section in QF:
SELECT * FROM Lntmu13.matter
WHERE mat_no = ?
When I pasted this in a custom query Workflow activity, it reports this error when I test it: Incorrect syntax near ‘?’
I am not trained in writing the queries, so I don’t know where to go from here.