Thursday, 8 September 2011

Decimal storage in SQL

What happens is it rounds off the hours to interger value. So if I insert 22.3 in the text box what i get in the database is 22 and if I insert 22.7 I get 23 in the database.


If you wanted to store up to 4 places after the decimal point, you could make it decimal(18,4).   Anything over 4 places would get rounded in that case.

No comments:

Post a Comment