Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mask a string

Status
Not open for further replies.

PavanKumarU

Programmer
Jan 31, 2003
56
US
hi,
Got a quick question. I dunno if i am misisng a function here.
I want a string which (if it is) is 5 chars in length to appear in 7 chars length.
for example.
If i am getting a string from database like 'Hello' i want it to be padded with two zeros like 00hello.
Can i do this is sql?
Any help is much appreciated.
Thanks
Pavan
 
try the replicate function:

REPLICATE('0', 7 - len(mystring)) + mystring

Chris.
 
hi,
Thanks Chris,
Thats exactly what i did.
Appreciate your help.
Thanks,
Pavan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top