>Dear Sir,
>
>I want to show it into Grid.
>
>Please help
You should certainly improve this code, but basically it will do what you want:
ALTER table testsub ADD COLUMN listorder C(1)
INDEX on name+listorder TAG gridorder
SELECT name,sum(amount) as amount,sum(bill) as bill FROM testsub ;
INTO CURSOR totals GROUP BY 1
INSERT INTO testsub (listorder,name,bill,amount) ;
SELECT 'S' as listorder,name,bill,amount FROM totals
USE in totals
CALCULATE SUM(amount),SUM(bill) TO nAmount,nBill IN testsub
INSERT INTO testsub (listorder,name,bill,amount) ;
values('T','zzz','nBill,nAmount)
INSERT INTO testsub (listorder,name,bill,amount) values('T','zzz',nBill,nAmount)
Edward Pikman
Independent Consultant