Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Posts
    5

    Unanswered: manipulation with numbers in SQL

    Hi folks,

    I am trying to divide a number by another number.. for example,

    '-5037542 / 143149696'

    The answer should be -0.03519.

    Inspite of using round,convert and numeric functions i am unable to get the answer as above. It calculates wrongly..

    I would appreciate if anyone could help.

    TIA,
    Nisha

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    int / int = int, convert either number to a float and you will get your answer
    Code:
    select -5037542 / cast(143149696 as float) as 'Ans'
    
    Ans                                                   
    ----------------------------------------------------- 
    -0.0351907278936869
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Sep 2002
    Posts
    5

    Thumbs up

    Thanks a lot Paul Young!!!

    -Nisha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •