Move Negative Sign From the End to the Beginning of a Varchar Column






DECLARE @value varchar(10) 
SET @value = '573.33-'

SELECT 
--sign(Reverse(@value))*(Reverse(Abs(Reverse(@value)))),

--Case WHen RIGHT(@value,1)='-' Then '-' Else '' End + replace(@value,'-',''),

Substring(@value+@value,len(@value)+Case WHen RIGHT(@value,1)='-' Then 0 Else 1 End  ,len(@Value))




 
Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s