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 |
reflex2dotnet
Yak Posting Veteran
99 Posts |
Posted - 2007-05-17 : 13:58:02
|
Hi allI am calculating a value as@test=(@stock/@AVERAGE)in my SPThe reulst i am getting forselect @test as Price is like 56.9877655544But how can i truncate so that i will get 56.98Please help me to fix thisThanks |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2007-05-17 : 14:05:40
|
Use the CONVERT function to convert the result to decimal(4,2).Or better yet, let your interface handle the formatting, because that is where such conversions are supposed to happen.e4 d5 xd5 Nf6 |
 |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-05-17 : 14:06:52
|
use decimal(X,2), wherre 2 is the precision. Declare @x decimal(15,8)set @x =56.9877655544select convert(decimal(10,2), @x) Dinakar NethiSQL Server MVP************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
reflex2dotnet
Yak Posting Veteran
99 Posts |
Posted - 2007-05-17 : 15:13:19
|
Thanks to allI will try your ideaThank you |
 |
|
|
|
|