• Yes, Keebler96, this is exactly how i need the row.

    I have updated the OP with better data.

    The order of the previous and the next rows should be ordered just like the SQL has inserted according to the primary keys.

    keebler96 (7/16/2013)


    Help us understand your requirements:

    If you picked:

    cost_center_code: 1

    Payment_code: 4

    Inv_no: 2

    What do you expect to see in the following columns?

    prev_cost_center_code:

    prev_Payment_code:

    prev_Inv_no:

    next_cost_center_code:

    next_Payment_code:

    next_Inv_no: