• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

SQL Server 2000 Division

I am not sure why I continue to receive 0 when I execute the statement below.

select (2/5)*100
1 Solution
Daniel WilsonCommented:
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)
DeMyuAuthor Commented:
Thank you

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now