Solved

Division 16/3 returns 5

Posted on 2009-04-14
2
223 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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