Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 how to add a white space after two numbers

Author  Topic 

ppatel112
Starting Member

35 Posts

Posted - 2011-08-21 : 21:07:58
Hi there,

i have certain phone numbers in a column in sql db that doesnt have any space in them.

for eg.
0299216500

how can i add a white space after two digits in the above number so that the number in the column becomes

for eg.
02 99216500

please advise.

regards

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-21 : 21:35:34
[code]SELECT STUFF(phoneno,3,0,' ') FROM Table[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -