• This should give you a start

    SELECTMONTH,

    SUM( CASE WHEN RN = 1 THEN MEASURE ELSE 0 END ) AS MEASURE1,

    SUM( CASE WHEN RN = 2 THEN MEASURE ELSE 0 END ) AS MEASURE2,

    SUM( CASE WHEN RN = 3 THEN MEASURE ELSE 0 END ) AS MEASURE3,

    SUM( CASE WHEN RN = 4 THEN MEASURE ELSE 0 END ) AS MEASURE4

    FROM(

    SELECTROW_NUMBER() OVER ( PARTITION BY MONTH ORDER BY LOCATION, STATUS DESC ) AS RN, *

    FROMYourTableName -- Enter your table name here

    ) AS YT

    GROUP BY MONTH

    PIVOT clause is available in SQL Server 2005 and higher versions

    You can find the your SQL Server Version by using below query

    SELECT @@VERSION


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/