The comma was part of it, but not the added text under Group. That was not it.
Ok, originally I thought the problem was the double quotes vs. single quotes, but thankfully the SQL query corrects that.
Now I managed to comment out the offending parts to find exactly where the problem is and I get the following:
I need all those fields in the SELECT section, but even adding ONE of them causes an error. I can do without the extra HAVING field.
For the record, this code works here when put into the query, but I need to be able to modify the year each time so I can't leave the 13M in there. It also pulls the data in the wrong order (correct order is above).
Bookmarks