Question : Pivot Data

I have a table that I do a select on:
Select rep, Grossrev,Mth from myTable

Returns this:

rep                  Grossrev    mth
amogavero      27108.8700      June
amogavero      14475.5200      July
bvance      9922.3700      July
cforbes      54689.8400      June
cforbes      18060.4500      June
cforbes      18748.4400      July
dsilverman      24598.8400      June

I NEED it to produce the following so I can place in a .Net repeater

rep                June                    July                        Sum
amogavero   27108.8700        14475.5200          41584.39
etc...

Answer : Pivot Data

Try this
1:
2:
3:
4:
5:
SELECT Rep,June,July
FROM (
SELECT Rep,Mnth,Grossrev FROM TablName)P
PIVOT 
(SUM(Grossrev) FOR Mnth IN (June,July))As Pvt
Random Solutions  
 
programming4us programming4us