Divide Decimal value By ^ value(XOR)

  • Hi all,

    I am working on Loan & EMI Interface...

    I need a help n how to divide Decimal Value by ^ value(XOR )

    For Example

    SELECT (1+ ((1.02/100))/12)) ^ 11

    In Stored Procedure

    DECLARE @ldc_interet_rate_1 DECIMAL(20,6)

    DECLARE @ldc_interest_rate DECIMAL(20,6)

    SELECT @ldc_interet_rate_1 = (( 1 + (@ldc_interest_rate/100)))^11

    Please help me on this task

    Thanks in Advance

    Regards

    Farooq.S

  • "^" means "Bitwise OR" in SQL and not an XOR. In most other things, it means "raised to a power". The formula you have appears to be an interest formula for 11 time periods and I'm very confused as to what you might possibly mean by "divide Decimal Value by ^ value(XOR )".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Sorry Jeff....

    For simple Understanding i vl give an example..Please hel;p me out

    Ex:

    how to calculate power vale in the Sql server

    Select 10 power of 2= 100

    (10)^2 = 100

  • Mr.Jeff

    It should Multiply with 'n' number to the value

    if 10 power 2 = 10 * 10 =100

    if 10 power 5 = 10 * 10 * 10 * 10 * 10 = 100000

  • POWER(10,2) = 100

  • G-472796 is correct. You're probably looking for the POWER function. Just keep in mind that POWER returns the same datatype as the first operand. For example, trying to take the square root of 3 with an Integer for the first operand will return a 1 instead of the expected answer.

    SELECT POWER(3,0.50000000)

    There's also more than one way to skin a cat. The following engineering notation is read as "1 times 10 raised to the power of 2".

    SELECT 1E2

    Of course, that notation won't take variables.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 5 (of 5 total)

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