in sqlserver database when i type 2.5 and save they did not taken decmical values how to do.when i save and again open only 2 not 2.5.
i need 2.5.
how to do.please help me
Rgds,
Narasiman P
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj RanaPosted Jul 6, 2012, 5:12 AM
The statement decimal (p, s) with p as precision and s as scale represents a decimal number with up to p digits and s of them will be on the right of the decimal point.
DECLARE @d decimal(8, 3)
SET @d=12345.67
SELECT @d
12345.670
Satyapriya NayakPosted Jul 6, 2012, 2:22 AM
Change the Data Type to
decimal(18, 1)
Thanks
Blocked AccountPosted Jul 6, 2012, 2:14 AM
Check the data type of column, in which you are storing value. I think it's int datatype.
If you want to store decimal values then take Float,decimal and numeric datatype instead of int.
Thanks
sudharsan sPosted Jul 6, 2012, 2:13 AM
what was the data type you given to that field? check it?
if you given int means change that into float or decimal ,numeric(10,2).
try this.
Hint : numeric(10,2)
2 represent maximum value display after decimal point.