• ASSUMING the order is dependent on the Payment_Code, then:

    Sample data:

    IF OBJECT_ID('tempdb..#Invoice_t') IS NOT NULL

    DROP TABLE #Invoice_t

    CREATE TABLE #Invoice_t(

    [Cost_Center_code] [int] NOT NULL,

    [Payment_code] [int] NOT NULL,

    [INV_No] [int] NOT NULL,

    CONSTRAINT [PK_Invoice_t] PRIMARY KEY CLUSTERED

    (

    [Cost_Center_code] ASC,

    [Payment_code] ASC,

    [INV_No] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 1, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 2, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 3, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 4, 2)

    --INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 5, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 6, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 7, 2)

    --INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 8, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 9, 2)

    INSERT #Invoice_t ([Cost_Center_code], [Payment_code], [INV_No]) VALUES (1, 10, 2)

    Then:

    SELECT

    t1.Cost_Center_code

    ,t1.INV_No

    ,(SELECT TOP(1) Payment_code

    FROM #Invoice_t

    WHERE Payment_code < t1.Payment_code

    ORDER BY Payment_code DESC)

    AS PrevCode

    ,t1.Payment_code

    ,(SELECT TOP(1) Payment_code

    FROM #Invoice_t

    WHERE Payment_code > t1.Payment_code

    ORDER BY Payment_code ASC)

    AS NextCode

    FROM

    #Invoice_t AS t1

    ORDER BY

    t1.Payment_code

    Output example (if you comment out one or more of the INSERT statements

    the correct Prev/Next values will display leaving out the missing value).

    Cost_Center_codeINV_NoPrevCodePayment_codeNextCode

    12NULL12

    12123

    12234

    12346

    12467

    12679

    127910

    12910NULL