Hi i want modify the below store procedure.

  • Hi

    This is the code

    SELECTRight(Replicate('0',15) + AccountNumber,15) AS 'AccountNumber',

    BankNumber,

    CASE SubProductCode WHEN '374' THEN 'P' ELSE 'D' END AS DDA_Prepaid_Indicator

    FROM DataStore.dbo.AccountsSent (nolock)

    WHERE BankNumber IN ('0000000001', '0000000034', '0000000802')

    AND ProductCode = '010'

    AND SubProductCode NOT IN ('147','165')

    ORDER BY BankNumber, AccountNumber

    in this code they check subproductcode is 374 then 'p' then else 'D'

    i need to check also if subproducode is 376 then 'p' then else 'D'

    Thank you..

    Thank you...

  • SELECTRight(Replicate('0',15) + AccountNumber,15) AS 'AccountNumber',

    BankNumber,

    --CASE SubProductCode WHEN '374' THEN 'P' ELSE 'D' END AS DDA_Prepaid_Indicator

    CASE WHEN SubProductCode IN ('374','376')

    THEN 'P'

    ELSE 'D' END AS DDA_Prepaid_Indicator

    FROM DataStore.dbo.AccountsSent (nolock)

    WHERE BankNumber IN ('0000000001', '0000000034', '0000000802')

    AND ProductCode = '010'

    AND SubProductCode NOT IN ('147','165')

    ORDER BY BankNumber, AccountNumber


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Hi,

    Thank you very much .. i got my anwer..

    i really appreciated..

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply