How to remove a 1000 seperator from a number
-
Hello everyone, I would like to know if there is a function that can get rid of a 1000 seperator. My Source data looks like this 1.676 3.349 109 58 70 1.887 I would like it to be like this: 1676 3349 109 58 70 1887 Does anyone know how I can fix this in my following statement please?
, CASE COALESCE(SHIPPED\_VAL\_MONTH, '') WHEN '' THEN 0 ELSE CAST(SHIPPED\_VAL\_MONTH as decimal(18,2)) END AS SHIPPED\_VAL\_MONTH
Kind regards,Ambertje
-
Hello everyone, I would like to know if there is a function that can get rid of a 1000 seperator. My Source data looks like this 1.676 3.349 109 58 70 1.887 I would like it to be like this: 1676 3349 109 58 70 1887 Does anyone know how I can fix this in my following statement please?
, CASE COALESCE(SHIPPED\_VAL\_MONTH, '') WHEN '' THEN 0 ELSE CAST(SHIPPED\_VAL\_MONTH as decimal(18,2)) END AS SHIPPED\_VAL\_MONTH
Kind regards,Ambertje
From sqlservercentral. Create a UDF and put this in it:
WHILE PATINDEX('%[^0-9]%',@string) <> 0
SET @string = STUFF(@string,PATINDEX('%[^0-9]%',@string),1,'')
SELECT @stringWrong is evil and must be defeated. - Jeff Ello
-
From sqlservercentral. Create a UDF and put this in it:
WHILE PATINDEX('%[^0-9]%',@string) <> 0
SET @string = STUFF(@string,PATINDEX('%[^0-9]%',@string),1,'')
SELECT @stringWrong is evil and must be defeated. - Jeff Ello
-
Hello Jörgen, Can you help me to create such a User defined function for my case please? I have little experiece with writing functions. Kind regards, Ambertje
You are going to get better value out of an article than a forum post, there is even one from CP in these results[^]
Ambertje wrote:
help me to create such a User defined function
That is not how the site works, we help you to learn how to create the functions, there are other sites that will do the job for you.
Never underestimate the power of human stupidity RAH