Count() is an aggregate function applied to either the entire record set or a group produced by the GROUP BY clause. Year and Month are not aggregate functions and I think that leads to an error here in your syntax.
Since your query does not actually refer to TouchYear and TouchMonth anywhere but in the "AS" clauses, why do you need them?
MSSQL and MYSQL respond to this Select statement as long as you have the ORDER BY and GROUP BY clauses defined. Is Filemaker looking for a different syntax?
I'm not sure. I'm far from expert with SQL myself, just looking for a possible reason for the ? syntax error result.
I don't think that you need both the ORDER BY and GROUP BY clauses here though that doesn't seem to be the cause of this issue here.
I just looked up "Group BY" in FileMaker Inc.'s SQL reference doc and found this example:
SELECT dept_id, SUM (salary) FROM emp GROUP BY dept_id
The only obvious difference that I see from your SQL is that the aggregate function is listed last.
Also from the same document:
"columns must match the column expression used in the SELECT clause. A column expression can be one or more field names of the database table separated by commas."
Hmmm, just had a light bulb pop on. Maybe the GroupBy and OrderBY clauses need to refer to these values by TouchYear and TouchMonth.