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.
| Author |
Topic |
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2008-05-15 : 04:23:12
|
| Hi guys,need your help.what can I do to convert the ff:00001250 to 000001250what syntax should I use?tnx |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-05-15 : 04:29:04
|
If you always want it to be 9 characters, then:select right('000000000' + '00001250', 9) |
 |
|
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2008-05-15 : 06:02:51
|
| thanks alot! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-05-17 : 09:03:51
|
| Another methodselect replace(str('00001250',9),' ','0')However consider doing the formation at the front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|