I can't seem to find where I'm missing an operator. I've looked at this many times, I tried signle quotes, double quotes, checked field names, I'm outta options.
Here is how "SQL1" is being created, this runs fine.
SELECT ID, Result, (SELECT COUNT(*) FROM Table1 G WHERE G.Result <> GR.Result AND G.ID <= GR.ID) AS RunGroup FROM Table1 AS GR;
Here is how "SQL2" is being created, this also runs fine.
SELECT Result, MIN(ID) AS StartID, MAX(ID) AS EndID, COUNT(*) AS Games FROM SQL1 AS A GROUP BY Result, RunGroup ORDER BY Min(ID);
When it comes to this query, is says syntax error, missing operator, then highlights "Result".
SELECT TOP 1 * FROM SQL2 A ORDER BY Games, WHERE Result = "W";
Suggestions?
WHERE Result = "W" ORDER BY Games;in other words take out the comma and switch the 'where' and 'order by clauses'