like this....?declare @t table (CustNo char(1),ConType int, [PO] varchar(5), [OR] varchar(5), [IN] varchar(5),[Misc] varchar(5), [Amount] money)insert into @tselect 'A',1,'P10', 'O120', 'I990', 'M1', 200.00 union allselect 'A',1,'P10', '-', 'I991', 'M1', 100.00 union allselect 'A',1,'P20', 'O120', 'I993', 'M2', 50.00 union allselect 'A',2,'P10', 'O120', 'I990', 'M3', 20.00 union allselect 'A',2,'P05', 'O120', 'I995', 'M4', 40.00 union allselect 'A',3,'P07', 'O134', 'I400', 'M4', 30.00 union allselect 'A',0,'-', 'O129', 'I999', 'M5', 60.00 union allselect 'A',0,'P05', 'O120', 'I995', 'M6', 10.00 select * from @tselect custno, SUM(amount) as [Amount],case when ConType = 1 then [PO] else '' end as [PO],case when ConType = 2 then [OR] else '' end as [OR],case when ConType = 3 then [IN] else '' end as [IN],case when ConType = 0 then [Misc] else '' end as [Misc]from @tgroup by CustNo,case when ConType = 1 then [PO] else '' end ,case when ConType = 2 then [OR] else '' end,case when ConType = 3 then [IN] else '' end ,case when ConType = 0 then [Misc] else '' end /*custno Amount PO OR IN MiscA 60.00 M5A 10.00 M6A 30.00 I400 A 60.00 O120 A 300.00 P10 A 50.00 P20 */
Em