ramadesai108
SSChampion
Points: 10609
More actions
November 17, 2011 at 9:18 am
#252096
I am trying the following at it give me zero, but it should be .16 :
select 1/6
What am I doing wrong?
Thanks.
SQLback
SSCrazy
Points: 2897
November 17, 2011 at 9:21 am
#1409295
Do this ...Select 1.0/6
Ken McKelvey
SSCoach
Points: 18843
November 17, 2011 at 9:23 am
#1409303
Zero is the correct answer as an integer divided by an integer is an integer.
If you want a floating point answer, make one for the constants a float.
eg SELECT 1.0/6;
Edit Sorry SQLBack; I did not see your reply.
November 17, 2011 at 9:24 am
#1409307
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply