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

Add leading zero's to a field 3

Status
Not open for further replies.

munzza

MIS
Aug 12, 2005
2
US
I am trying to create a crystal report that pulls data from a customer order screen in our business system to be exported to a text file and sent to one of our customers. The field is a customer order line number e.g 32 The customer requires this field to be 5 charactacters in length with leading zeros e.g 00032. Can someone help me with the formula to perform this conversion?

Thanks in advance!

Munzza
 
numeric field:
right("00000" + totext(number,0), 5)

alphanumeric
right("00000" + number,5)

where number is your "line number
 
Try:

totext({table.number},"00000")

If it is already a string, then try:

totext(val({table.string}),"00000")

-LB
 
Thankyou for the tips. They worked exactly as needed!

Munzza.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top