SET SAFETY OFF CREATE TABLE temp (FLG1 C(10),EMPNO N,VALUE1 N,A1 N,B1 N,C1 N,D1 N) INSERT INTO temp VALUES ("A",1,10,0,0,0,0) INSERT INTO temp VALUES ("B",1,20,0,0,0,0) INSERT INTO temp VALUES ("C",1,30,0,0,0,0) INSERT INTO temp VALUES ("D",1,40,0,0,0,0) INSERT INTO temp VALUES ("B",2,3,0,0,0,0) INSERT INTO temp VALUES ("C",2,5,0,0,0,0) INSERT INTO temp VALUES ("D",2,7,0,0,0,0) INSERT INTO temp VALUES ("B",3,3,0,0,0,0) INSERT INTO temp VALUES ("D",3,7,0,0,0,0) INSERT INTO temp VALUES ("C",4,3,0,0,0,0) BROW **I NEED RESULT AS ONE RECORD FOR EMPNO AS EMPNO A1 B1 C1 D1 1 10 20 30 40 2 0 3 5 7 3 0 3 0 7 4 0 0 3 0>>thank you for reply
>>select min(flg1) as flg1, EmpNo,min(SUM_SUM_TO) as SUM_SUM_TO,; >>max(iif(flg1='A',SUM_SUM_TO,0)) as A1, ; >>max(iif(flg1='B',SUM_SUM_TO,0)) as B1, ; >>max(iif(flg1='C',SUM_SUM_TO,0)) as C1, ; >>max(iif(flg1='D',SUM_SUM_TO,0)) as D1 from TWW GROUP BY EmpNo ORDER BY EmpNo >> >>INDEX ON EMPNO TO AA >>BROW >>>I am not sure I understand what do you mean. Does the query produce correct result? If not, what data do you have and what do you get with this query?