• bryan van ritter (3/29/2013)


    Hi,

    i have a table which looks like this:

    custiditemdateamount

    131-1-2013 1

    121-1-2013 2

    241-2-2013 2

    241-2-2013 1

    and i want to make it look like this:

    dateitem1item2item3

    1-1-2013

    custid

    1201

    1311

    1411

    1-2-2013

    custid

    2511

    2111

    2411

    can anyone help me with some guidence on this

    thanx in advance,

    regards,

    bryan

    I would recommend you take a few minutes and read the article found at the first link in my signature. It explains the best practices for posting questions. If you post ddl, sample data and desired output like in that article you will have lots of people jumping on your issue and you will get an answer very quickly.

    _______________________________________________________________

    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/