Solved

Division 16/3 returns 5

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

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…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

22 Experts available now in Live!

Get 1:1 Help Now