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

delete leading zeros in lotus approach records? 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am using Lotus Approach in accessing a dbaseIII+ file which contains mail
addresses. To my chagrin, there are unnecessary zeros in front of the street
address digits, instead of "3495 Ventura Bl." there is "0003495 Ventura Blvd.".

Is there a method whereby I can remove these zeros, other than manually going to each record & removing them?

All replies, opinions, etc. welcomed!

Aaron in N. Hollywood
 
If the leading zeros are always at the left side of the field followed by at least one blank, it is not too complicated to automate. Assuming your address field name is "streetfield", set up some calculated fields like this:

1) Get the number out of the streetfield:
PosBlank = Position(streetfield,' ',1)
CalcNum = 1 * Left(streetfield,PosBlank - 1)

2) Check to see if the numeric value is equal to the original value to make sure you have numbers at the left instead of things like "PO" or "Suite":
NumOK = If(CalcNum = Left(streetfield,PosBlank - 1),1,0)
NewStreet = If(NumOK = 1,Combine(CalcNum,' ',Right(streetfield,Length(streetfield) - PosBlank)),streetfield)

3) Display the original field streetfield and these calculated fields on a worksheet view so that you can see if the NewStreet value is correct. Note that I did not set up a test case for this as I am operating from memory!

4) If all is well, you can then click Worksheet, then Fill Field and direct Approach to fill the streetfield with the value in NewStreet.

Sue Sloan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top