• goodtomorrow01 (11/27/2012)


    We have a following table:

    [Day] [Time]

    Mon 07:00

    Tue 12:00

    Mon 10:00

    Mon 15:00

    Tue 15:00

    Tue 20:00

    I want to make a query in sql 2005 to have the following result:

    07:00 10:00 12:00 15:00 20:00

    Mon Mon Tue Mon Tue

    NULL NULL NULL Tue NULL

    Please help me do it?

    Thank you very much!

    Nobody can help you because you didn't provide enough details for somebody to help. Please see the first link in my signature for best practices when posting a question.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/