DECLARE@count NUMERIC(8, 2)
set @count = 165.165
Result is giving '165.17' where as i need '165.16'
it should not round of the number
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Answer by Kev Riley · Jan 21, 2019 at 01:06 PM
You need to explicitly truncate the number using the 3rd argument in the ROUND() function
declare @count NUMERIC(8, 2)
set @count = round(165.165,2,1)
Answers Answers and Comments
17 People are following this question.
Resource DataBase in Sql Server
How can I resolve SQL server connection error?
Creation of Index in separate filegroup
SQL Server Backup to Network Location Slow
Merge Replication error between SQL 2008 R2 publisher & SQL 2012 Subscriber