all groups > sql server mseq > september 2004 >
You're in the

sql server mseq

group:

how to suppress zeroes after decimal and whole no. should remain same


how to suppress zeroes after decimal and whole no. should remain same hari
9/23/2004 1:20:25 AM
sql server mseq:
hi ,

but it is not working for whole number like ex:11120
it is fetching it as 11120. (with point at the end)
how to do that.

thanks,

hari.
[quoted text, click to view]

thanks,
hari.

[quoted text, click to view]
Re: how to suppress zeroes after decimal and whole no. should remain same Anith Sen
9/23/2004 2:44:10 PM
You can try the following expression:

LEFT( c, LEN( c ) - PATINDEX( '%[1-9]%', REVERSE( c ) ) + 1 )

: where c is your column

--
Anith

Re: how to suppress zeroes after decimal and whole no. should remain same Vishal Parkar
9/24/2004 12:24:13 AM
check my other reply.

--
Vishal Parkar
vgparkar@yahoo.co.in | vgparkar@hotmail.com

Re: how to suppress zeroes after decimal and whole no. should remain same Steve Kass
9/26/2004 1:08:49 AM
Not quite. This will format 3000.000 as '3' .

SK

[quoted text, click to view]
Re: how to suppress zeroes after decimal and whole no. should remain same Steve Kass
9/26/2004 1:11:15 AM
Here is another option:

select
parsename(c1,2)
+ coalesce('.'+reverse(0+nullif(reverse(parsename(c1,1)),0)),'')
from test

SK

[quoted text, click to view]
Re: how to suppress zeroes after decimal and whole no. should remain same hari
9/27/2004 6:43:31 PM
thanks Steve,
it's working fine for removing zeroes and formating it
with commas. i changed it with combining ur previous and
current answers.

rgds,
hari.

[quoted text, click to view]
AddThis Social Bookmark Button