Division 16/3 returns 5

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!
T-VirusAsked:
Who is Participating?
 
chapmandewConnect With a Mentor Commented:
so...


select cast(16 as decimal)/3
0
 
chapmandewConnect With a Mentor Commented:
try this:

select 16.0/3
0
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.

All Courses

From novice to tech pro — start learning today.