I have created a Grid application with my own SQL statement to group and sum totals:
SELECT
cl.clName,
sum(mi.mntTotalCharge) as total,
mi.mntMonth,
mi.mntYear
FROM
Clients cl INNER JOIN Agreements agr ON cl.cID = agr.cID
INNER JOIN MonthlyInvoices mi ON agr.agrID = mi.agrID
where mi.mntMonth = Month(now()) and mi.mntYear =year(now())
Group by cl.clName,mi.mntYear,mi.mntMonth
order by total DESC
limit 10
Scriptcase “ignores” this statement and groups the first 10 clients in the table and shows them alphabetically.
What am I missing when executing custom SQL ?