I have made a query in AOT. My goal is to print information using Group by "CustGroup" and Order by "count(RecId)" desc of CustTable table. The group by works properly, but the order by does not. I can not understand why...
This is what my query looks like:
This is code I use:
Static void Query(Args _args)
{
QueryRun qr;
CustTable myCustTable;
;
qr = new QueryRun(queryStr(MyQuery));
while(qr.next())
{
myCustTable = qr.get(tableNum(CustTable));
info(strFmt("Group %1 Num %2", myCustTable.Custgroup, myCustTable.RecId));
}
}
The result is: