• I see what you are saying about the row number but I am a bit confused about the process as a whole. Why would the rowNumber change based on return date? It seems that something is lost in translation. Probably due to the fact that this was something I looked at a few weeks ago and don't remember the nitty gritty details. It will take me some time to parse through all 50+ posts and wrap my head around this again. It seems that maybe all that is missing is including a RowNumber from the returns side or something like that. I will try to find a couple hours to dig through this again and see if I can see see what the issue is.

    _______________________________________________________________

    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/