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!

Adding two fields together

Status
Not open for further replies.
Apr 6, 2004
33
US
Hello,
Does anybody know how to add two fields together in a foxpro table? What I have in one table is areacode in one field and the phonenumber in another field. I want to add these
fields together to make one field with areacode + phonenumber as one.

Thanks
Tim
 
Concatenating two string fields into one single value is as simple as:

mcNewString = mcString1 + mcString2

In order to end up with a single value in your table representing the AreaCode + PhoneNumber you first have to ensure that your target field will hold enough characters.

Next you have to ensure that both source fields as in character form - or else perform the necessary number-to-character conversion within your REPLACE command.

Assuming that you have done the prior-work...
Code:
REPLACE ALL Telephone with AreaCode + PhoneNumber
should do the job.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top