If you don't need pretty you can use this:
select code,branch,amount,sum(amount) as Total
group by code,branch,amount with rollup
If you need pretty you can use case and the with grouping function.
Ray Higdon MCSE, MCDBA, CCNA
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!