• If I'm not mistaken you want a row for every date/time combination and put the values in different columns?

    This would be done with a PIVOT statement.

    Using PIVOT and UNPIVOT

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP