Home > DeveloperSection > Forums > SQL Server Spaces within a string
Jeet Verma
Jeet Verma

Total Post:110

Points:776
Posted on    November-06-2014 3:37 AM

 MSSQL Server SQL Server  SQL 
Ratings:


 1 Reply(s)
 596  View(s)
Rate this:

I need to add spaces within a string.

Original String: up70aert55
Expected Result: up 70 aert 55


Takeshi Okada
Takeshi Okada

Total Post:89

Points:629
Posted on    November-06-2014 6:26 AM

can achieve this with LEFTSUBSTRINGRIGHT functions.

SELECT LEFT('up70aert55',2)+' '+
SUBSTRING('up70aert55',3,2)+' '+
SUBSTRING('up70aert55',5,4)+' '+
RIGHT('up70aert55
',2);

Modified On Nov-06-2014 06:27:07 AM

Don't want to miss updates? Please click the below button!

Follow MindStick