Use
GROUP BY DATEPART(DAYOFYEAR, YourDate)
But add some logic for a readable presentation because 1-365 is not a common used date format.
See the documentation here: https://docs.mendix.com/refguide/oql-datepart/
So use something like DATEPART(DAY, yourDate)
Regards,
Ronald
Check the OQL-demosite on service.mendixcloud.com and go to OQL-playground:
There you can find examples and test your solution.
See example under button :
FROM Sales.Customer AS c
GROUP BY DATEPART(WEEKDAY,Birthday)
SELECT DATEPART(WEEKDAY,Birthday) AS BirthWeekday_Sundayis1,
count(*) as NumOfPersons
ORDER BY BirthWeekday_Sundayis1 ASC