Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Is there a mathematical function that will round a decimal number to 2 decimal places? For example:Change this: 12345.62764To this: 12345.63... OR ...Change this: 12345.61247To this: 12345.61- - - -- Will -- - - -http://www.willstrohl.com
TG
Master Smack Fu Yak Hacker
6065 Posts
Posted - 2009-08-19 : 15:44:47
see which option works best for you:
select round(n, 2) as [round] ,convert(decimal(7,2), n) [convert]from ( select 12345.62764 as n ) doutput:round convert--------------------------------------- ---------------------------------------12345.63000 12345.63