Hello List!
I have a question...
I want to round a number to the nearest half --
I tried this:
But, am getting an error msg:
Msg 195, Level 15, State 10, Line 2
'dec' is not a recognized built-in function name.
I found this explanation online of how to accomplish this:
1. Multiply the number by the reciprocal of the fraction.
2. Round to a whole number.
3. Divide by the reciprocal of the fraction.
So, my number is 42.656621, and I want the nearest half --> 42.500000.
Need to do this for the nearest quarter, twentieth, and hundredth as well, but first want to get the half down and work up from there!
Which I'm trying to do, but the 'dec' part is giving me some problems...Any thoughts or ideas?
Thanks much! Your expertise and time are very much appreciated!!
-jiggyg
I have a question...
I want to round a number to the nearest half --
I tried this:
Code:
select addID,
addLat, dec(round(addLat * 2, 0)/2,11,1) as Nearest_Half
from Addresses
But, am getting an error msg:
Msg 195, Level 15, State 10, Line 2
'dec' is not a recognized built-in function name.
I found this explanation online of how to accomplish this:
1. Multiply the number by the reciprocal of the fraction.
2. Round to a whole number.
3. Divide by the reciprocal of the fraction.
So, my number is 42.656621, and I want the nearest half --> 42.500000.
Need to do this for the nearest quarter, twentieth, and hundredth as well, but first want to get the half down and work up from there!
Which I'm trying to do, but the 'dec' part is giving me some problems...Any thoughts or ideas?
Thanks much! Your expertise and time are very much appreciated!!
-jiggyg