Solved

Division 16/3 returns 5

Posted on 2009-04-14
2
185 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
  • 2
2 Comments
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 125 total points
Comment Utility
try this:

select 16.0/3
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 125 total points
Comment Utility
so...


select cast(16 as decimal)/3
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

15 Experts available now in Live!

Get 1:1 Help Now