I want to ask if anybody know the query to drop the 0 value in decimal..
E.g : A field name percent have these values
770.00000000000000000000,
You can use CONVERT
function twice, once to drop 0
by converting to float and once to convert it to varchar with style 128
DECLARE @Sample AS TABLE
(
SomeNumber DECIMAL(26, 12)
)
INSERT INTO @Sample
VALUES ( 770.00000000000000000000 )
, ( 340.670000000000000000000 )
, ( 96.00000000000000000000 )
, ( 4400.56000000000000000000 )
, ( 109.89000000000000000000 )
, ( 109.00000000000000000000 )
, ( 37.00000000000000000000 )
SELECT CONVERT(VARCHAR(25), CONVERT(FLOAT, SomeNumber), 128) AS NoZeros
FROM @Sample