var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Replacing one part of a number
I need to change the first digit (0) in a number, like 05678494 and replace it with 0046 so it would look like 00465678494 when it is done.
I have tried to use the REPLACE function without any success.
Can anyone help me?
What datatype is your value?
What about this:
REPLACE('X' + YOURNUM, 'X0', '0046')
Last edited by blindman; 12-01-04 at
Well, first it's not really a number
Second, If you have any "congac" strings * any where else in the string, they'll get replaced as well...
Third, if it always the first 0, then
Should do it
DECLARE @x varchar(20)
SELECT @x = '05678494'
SELECT @x = CASE WHEN SUBSTRING(@x,1,1)= 0 THEN '0046' + SUBSTRING(@x,2,LEN(@x)-1) ELSE @x END
I thought you were a margarita drinker?
You brought up the X0
I had X0 once...believe it was Remy..smoooooooooth
And I'm an equal opportunity patron....