• I'm posting a different option that will read the table just once. It might be faster but I can't assure that. I included an option with ISNULL which will work for 2 options and an option with COALESCE which will work with multiple options but need to be casted to retain the datatype.

    SELECT t.CalendarDate,

    ISNULL(MAX( CASE WHEN t.UOM = 'F' THEN t.Temperature END), MAX( CASE WHEN t.UOM = 'C' THEN (t.Temperature * 1.8000) + 32.00 END)) AS Fahrenheit,

    CAST( COALESCE(MAX( CASE WHEN t.UOM = 'F' THEN t.Temperature END), MAX( CASE WHEN t.UOM = 'C' THEN (t.Temperature * 1.8000) + 32.00 END)) AS decimal(10,2)) AS Fahrenheit2

    FROM @Temperature t

    GROUP BY t.CalendarDate

    ORDER BY t.CalendarDate

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2