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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Padding? 1

Status
Not open for further replies.

KizMar

Technical User
Mar 13, 2002
52
US
Problem:

I have a column that's a float (currency), so I could have "110.01" or "1.2" or "12" in the fields.

I need this field to show as 11 characters set. Ex. "00000123456" - where the last two digits are the cents.

I have the front of the string padded, but can't figure out how to take out any "." that exist and add "0" where needed.

Help?
 
Hi,

Try this

select replicate('0',11-len(reverse(reverse(fldname*100)))) + reverse(reverse(fldname*100)) from tbl


Hope it helps
Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top