• Lynn Pettis (4/3/2013)


    Does this help you figure out how to query the data into a format you can use? Personally, I'd load the data as is from Excel into a staging table then pivot it from there using SQL.

    declare @TestTable table(

    ServerName varchar(10),

    Cost varchar(4),

    Value int);

    insert into @TestTable

    values

    ('SAB245','DRU',200),

    ('SAB246','DRU',2001),

    ('SAB247','TAPE',300),

    ('SAB248','TAPE',3001),

    ('SAB249','DISK',100),

    ('SAB250','DISK',1001);

    select

    ServerName,

    DRU,

    [TAPE],

    [DISK]

    from

    (select

    ServerName,

    max(case Cost when 'DRU' then Value end) as DRU,

    max(case Cost when 'TAPE' then Value end) as [TAPE],

    max(case Cost when 'DISK' then Value end) as [DISK]

    from

    @TestTAble

    group by

    ServerName

    )dt;

    This would work if you were pulling from sql, however since pulling from excel it would be ineffective.