SELECT round(AVG(CONVERT(dECIMAL(10,2),IMS)),2) fROM IND13I.DBO.MSTMASSSTUDENTS
WHERE Course='B.Arch' and semester=1 and subjectcode='ar-101'
and ims not in('i','e','l','','ab')
The result is 30.800000
Why not 30.80
Microsoft SQL Server 2008
Last Comment
searchsanjaysharma
8/22/2022 - Mon
Jim Horn
Not sure why, but ROUND does the rounding, but does not alter the percision/scale of the value being rounded.
CAST(your_number as decimal(19,2)) will return only two decimal places.
SELECT ROUND(18.2000000,2)SELECT CAST(18.200000 as decimal(19,2))
CAST(your_number as decimal(19,2)) will return only two decimal places.
Open in new window