Friday, February 24, 2012

Eleminate trailing zeros in the numeric field

Hello,
I have a numeric field with 4 decimal places.
In the select query i want to eliminate trailing zeros.
DB Value Result
1.1234 1.1234
1.1230 1.123
1.1200 1.12
1.1000 1.1
1.0000 1
Thanks in advance.
M. SubbaiahWhat you want to do is formatting a string. In order to do that you need to
CAST the value to a character data type. Do you really want to do that?
Anyway, here's a nice article on casting and converting data in SQL:
http://msdn.microsoft.com/library/d...br />
2f3o.asp
Look at the style parameter.
ML
http://milambda.blogspot.com/

No comments:

Post a Comment