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

address string manipulation 5

Status
Not open for further replies.

oanion

IS-IT--Management
Jun 18, 2004
55
Good Day All,

I was wondering if someone could give me a hand. I have an address field that has everything in one field separated by a dash
For example:

Billy Martin-C/O NationsBank-2059 Northlake Parkway-Atlanta, GA 30032

I need the address to print in the following format on that report:

Billy Martin
C/O NationsBank
2059 Northlake Parkway
Atlanta, GA 30032

I’ve already used the following split function to take out the dashes as follows:

address := split({vPOC_B10_REPORT.NOTICESADDR},"-")[1];

However, I’ve had to create 4 different formulas and each formula has a change in the subscript after the split function. For example:


address := split({vPOC_B10_REPORT.NOTICESADDR},"-")[2];

My question is, how can I get the address to print in the address format listed above by 1 formula instead of using 4 different formulas?


 
Try:

Replace({vPOC_B10_REPORT.NOTICESADDR},"-", chr(13))

Drag it onto the report and format it with the 'Can Grow' option.

-dave
 
Instead of using split. Replace the "-" with a carriage return chr(13).

replace("Billy Martin-C/O NationsBank-2059 Northlake Parkway-Atlanta, GA 30032","-",chr(13))

Put your field in where the text is.

Lisa

 
Another means is to use the split, but add in a join:

join(split({vPOC_B10_REPORT.NOTICESADDR},"-"),chr(13))

Since you're dealing with 4 address lines, you might adapt Dave's function as follows to avoid blank lines:

Replace(
replace({vPOC_B10_REPORT.NOTICESADDR},"--","-")
,"-", chr(13))

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top