I have a result set that looks like the below. Can anyone show me how to "pivot" this , so 

```
datadate , timestart , timeend , datatype , datacount , datasum
2013-06-03 ,  20:00:00.0000000 ,  21:00:00.0000000 , 10 , 3 , 30
2013-06-03 ,  20:00:00.0000000 , 21:00:00.0000000 , 20 , 3 , 30
2013-06-03 ,  20:00:00.0000000 , 21:00:00.0000000 , 30 , 3 , 30
2013-06-03 ,  19:00:00.0000000 , 20:00:00.0000000 , 10 , 2 , 20

```

can turn into this

```
date  ,  timestart   timeend   , type10count , type10sum , type20count , type20sum , type30count , type30sum
2013-06-03 , 20:00:00.0000000 , 21:00:00.0000000 , 3 , 30 , 3 , 30 , 3 , 30
2013-06-03 , 19:00:00.0000000 , 20:00:00.0000000 , 2 , 20 , 0 , 0 , 0 , 0

```

I was trying to make a PIVOT to avoid a CASE statement and redefining a new table but am coming up short.
How should this be done?

```
    declare @starttable table
    (
    datadate date , timestart time , timeend time , datatype tinyint , datacount int , datasum int
    )
    insert into @starttable  
    select '2013-06-03' , '20:00:00' , '21:00:00' , 10 , 3 , 30
    union all
    select '2013-06-03' , '20:00:00' , '21:00:00' , 20 , 3 , 30
    union all
    select '2013-06-03' , '20:00:00' , '21:00:00' , 30 , 3 , 30
    union all
    select '2013-06-03' , '19:00:00' , '20:00:00' , 10 , 2 , 20

    select datadate , timestart , timeend 
    from ( select datadate , timestart , timeend , datacount ,datasum from @starttable ) as t1
    pivot ( sum(datasum) for datatype in (datacount,datasum) ) as t2
-- yes i know sql server gongs this

```