The error message is fairly specific - it points you to the line and location, line 23 col 10, and says that DATA.DocDate must be in a group by clause. Let's look at line 23 along with the line right before:
Basically the problem is that the expression you're ordering by is different from the expression you're grouping by. They need to be consistent. You cant say group by month, ignoring the rest of the date, and then tell it to sort them by date. You either want
or
(It also looks like you can say either data."DocDate" or just "DocDate" - but I prefer to include the table when possible, and be consistent.)