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
 General SQL Server Forums
 New to SQL Server Programming
 change format

Author  Topic 

jasonsy
Starting Member

11 Posts

Posted - 2010-03-11 : 02:43:47

how can i change the format from 51000012 to 51-00001-2?

thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-11 : 02:52:35
fixed position ?

select stuff(stuff('51000012', 3, 0, '-'), 9, 0, '-')



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jasonsy
Starting Member

11 Posts

Posted - 2010-03-11 : 03:02:01
thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-11 : 04:04:49
quote:
Originally posted by jasonsy


how can i change the format from 51000012 to 51-00001-2?

thanks




If you use front end application, do this formation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -