• Japster (4/9/2014)


    Sean Lange (4/9/2014)


    Japster (4/9/2014)


    Hi,

    thanks for the reply, for this exercise there will always be 7 serials per box.

    However there is data in the table that has 42 serials in a box, will that cause a problem ?

    Thanks

    Nope. Look at the example I linked yesterday. It will show exactly how to do this kind of thing.

    Yes I looked at the link you provided yesterday and I still don't get it, sorry my SQL skills are weak :ermm:

    OK. Then I am not going to post the code because you need to understand any code that you use. Let's break this down into pieces to help you understand what is going on.

    The first step was to create a cte to allow us to number the rows. Do you understand the cte I used? Did you understand why I did that?

    _______________________________________________________________

    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/