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 2000 Forums
 SQL Server Development (2000)
 complete zero's

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-04-24 : 02:47:05
how can i complete zero's on a colun that i take if for example the number of chars is les then 10 for example :
"werwer" ->"0000werwer"
"43dgfwesdb" --> no need to complete
how can i do this as a part of a select?
thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-24 : 02:50:03
select right('0000000000' + yourcol, 10)



KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-24 : 02:51:51
If you use Front end application use Format function there

Madhivanan

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

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-04-24 : 03:05:22
thnasks alot for the
right('0000000000' + yourcol, 10)
idea

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page
   

- Advertisement -