Sorry I forgot to paste the code in the previous email.
Select
COUNT (MS_DRG) as 'cntof MS_DRG',ms_drg, FYFP,
MS_DRG as '765',
MS_DRG as '766',
FYFP
from #TSI_patient_list_Csections
group by FYFP,ms_DRG
I need the table to look like this ...
FYPer/Yr 765766
4/2012 4041
5/2012 3853