Friday, March 9, 2012

How to set precision of a decimal number

there is a column which type is float in a table, i want to set the precision of its value, for example if its value is 10.333888, i want to get its value as 10.33, how to complete it in a select Sql?

thks

You can change yourcolumn to numeric or decimal data type, for example, decimal(18,2) or numeric(18,2), which will return 10.33 in your case.

You can look up the difference between numeric and float data type from Books Online which covers everything you need for SQL Server.

HTH

|||thks for HTH, i have solved my problem with your method, thks again

No comments:

Post a Comment