SQL Server 2000 Division

Posted on 2009-02-09
Last Modified: 2012-05-06
I am not sure why I continue to receive 0 when I execute the statement below.

select (2/5)*100
Question by:DeMyu
    LVL 32

    Accepted Solution

    2/5, though it equals 0.4, rounds down to 0 when using integer arithmetic.  Multiplying by 100 ... doesn't help.
    select (2.0/5)*100
    yields what you expected.

    So does
    select (2*100/5)

    Author Closing Comment

    Thank you

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Viewers will learn how the fundamental information of how to create a table.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now