Solved

Division 16/3 returns 5

Posted on 2009-04-14
2
227 Views
Last Modified: 2012-05-06
Hi,

I am sure you have a solution for this problem...

Select 16/3 AS [Result]

It returns 5... shouldnt it return 5.333333 ?

If tryed aswell

Select Cast (16/3 AS DECIMAL(5,2)) AS Result
It returns 5.00

I don't get it!
0
Comment
Question by:T-Virus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 125 total points
ID: 24139579
try this:

select 16.0/3
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 125 total points
ID: 24139583
so...


select cast(16 as decimal)/3
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

724 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