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 |
zeeshan13
Constraint Violating Yak Guru
347 Posts |
Posted - 2008-05-16 : 08:39:36
|
Hi All,I have a small question to ask. How to round a numeric field upto 2 decimal places, and also show it with 2 decimal places onlyFor example the following would return 255.88000000000select round(255.87908765444,2)How to get 255.88 only?Pleas help.Thanks,Zee |
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2008-05-16 : 08:49:26
|
hi try this select convert(decimal(5,2),round(255.87908765444,2))oktanx... |
 |
|
zeeshan13
Constraint Violating Yak Guru
347 Posts |
Posted - 2008-05-16 : 10:54:37
|
Thanks soorajtnpki.... |
 |
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2008-05-16 : 11:17:28
|
You want to round up to 2 decimal places? The function there will round 255.87408765444 down (to 255.87)...Ryan Randall Solutions are easy. Understanding the problem, now, that's the hard part. |
 |
|
|
|
|