• -- This looks correct:

    SELECT

    ERP_ID,

    customer_number,

    ANNUAL_CONTRACT_PRICE,

    [Rank]

    FROM (

    SELECT

    ERP_ID,

    customer_number,

    ANNUAL_CONTRACT_PRICE,

    ROW_NUMBER() OVER (PARTITION BY customer_number ORDER BY ANNUAL_CONTRACT_PRICE DESC) AS [Rank]

    FROM EMEA_SERVICEMAX.Servicemax.SERVICE_CONTRACTS_STG

    WHERE CONTRACT_START_DATE >= GETDATE()-730

    AND CONTRACT_STATUS_DESCRIPTION NOT IN ('Free','Canceled','Cancelled')

    ) a

    WHERE a.[rank] <=5

    AND a.CUSTOMER_NUMBER = '110000053'

    -- Test it:

    SELECT TOP 5 *

    FROM EMEA_SERVICEMAX.Servicemax.SERVICE_CONTRACTS_STG

    WHERE CONTRACT_START_DATE >= GETDATE()-730

    AND CONTRACT_STATUS_DESCRIPTION NOT IN ('Free','Canceled','Cancelled')

    AND a.CUSTOMER_NUMBER = '110000053'

    ORDER BY ANNUAL_CONTRACT_PRICE DESC

    -- Suggestions:

    -- Use a variable for the cutoff date and remove the time component

    SELECT @CutoffDate = DATEADD(day,DATEDIFF(day,0,GETDATE()-730),0)

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden