Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Bex
Aged Yak Warrior
580 Posts |
Posted - 2008-09-26 : 11:32:59
|
| I want to round a value down to the last penny and CONVERT to 2 decimal points:2.048000 = 2.041.184000 = 1.182.760000 = 2.760.995000 = 0.99I CONVERT the values to NUMERIC, and the values are rounded up:SELECT CONVERT(NUMERIC (18,2),2.048000) = 2.05How can I ensure the values are rounded DOWN?ThanksHearty head pats |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-26 : 11:41:38
|
quote: Originally posted by Bex I want to round a value down to the last penny and CONVERT to 2 decimal points:2.048000 = 2.041.184000 = 1.182.760000 = 2.760.995000 = 0.99I CONVERT the values to NUMERIC, and the values are rounded up:SELECT CONVERT(NUMERIC (18,2),2.048000) = 2.05How can I ensure the values are rounded DOWN?ThanksHearty head pats
What is your expected result?MadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-26 : 11:41:54
|
You mean you want to TRUNCATE the decimals?SELECT ROUND(Col1, 2, 1)FROM Table1 E 12°55'05.63"N 56°04'39.26" |
 |
|
|
Bex
Aged Yak Warrior
580 Posts |
Posted - 2008-09-26 : 11:46:08
|
| Thankyou. Exactly what I wanted!Hearty head pats |
 |
|
|
|
|
|