Hi,
I got the following to work with cursors:
SELECT month(logindate) AS M, cmonth(logindate) AS MN, id, COUNT(id) AS LCount
FROM logintrack
GROUP BY M, id
INTO CURSOR temp_logintrack
SELECT M, MN, LCount, COUNT(Lcount) AS AggLCount
FROM temp_logintrack
ORDER BY M, LCount
GROUP BY M...