Ever faced the above two errors?? and really in a need of some solution? Don’t worry… here you will find the solution.
The scenario is such that you have downloaded your fetchxml from advance find view, made it aggregate = “true” and added the code for count/sum/groupby etc, copied it and pasted int the query area of your report. And when you execute the query, this dreadful error is popped up. What you need to do is just make sure of the following things:
a) you don’t have any orderby in your code, coz it doesn’t work with aggregates without aliases
b) you should be having either group by = “true” or aggregate = “sum”/”count” (as per your need) with each attribute you add along with the alias defined. Remember, you have to add “group by” with all attributes that you have got in your fetchxml query.
here’s an example:
also with this query you can have your data grouped month/year wise
So.. done with the error fixes ? Happy coding! 😀