SET MULTILOCKS ON CREATE TABLE temp ( group c(1), value I ) INDEX ON group TAG group INSERT INTO temp (group, value ) VALUES ('A', 1) INSERT INTO temp (group, value ) VALUES ('A', 2) INSERT INTO temp (group, value ) VALUES ('B', 1) INSERT INTO temp (group, value ) VALUES ('B', 2) SELECT group, sum(value) FROM temp GROUP BY group INTO CURSOR c_1 CURSORSETPROP("Buffering" ,5, 'temp') INSERT INTO temp (group, value) VALUES('C', 1) INSERT INTO temp (group, value) VALUES('C', 2) SELECT group, sum(value) FROM temp GROUP BY group INTO CURSOR c_2 && no 'C' group here CREATE CURSOR c_3 (group c(1), value i) SELECT temp LOCATE && go top DO WHILE NOT EOF() m.group = group SUM value TO value WHILE group == m.group INSERT INTO c_3 FROM MEMVAR ENDDO SELECT c_3 && this one has all the groups>Hi U.T. members!!