• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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