Results 1 to 2 of 2

Thread: Percent in sql

  1. #1
    Join Date
    Mar 2004

    Post Unanswered: Percent in sql

    I need rate to be a percent, it is returning 1 where XX=YY (e.g 100/100=1), but when the number (rate) is a fraction (90/100=.9)I am getting 0. Don't know what the problem is.

    select XX as X, YY as Y, (YY/XX) as rate from blah where blah group by XX, YY order by XX

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    PHP Code:
    SELECT 90 CAST(100 AS real
    Integer math doesn't do the decimal thing very well!


Posting Permissions

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