×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

COLUMN 1 TABLE VALUE IS A MERGE OF COLUMN 2 AND 3

COLUMN 1 TABLE VALUE IS A MERGE OF COLUMN 2 AND 3

COLUMN 1 TABLE VALUE IS A MERGE OF COLUMN 2 AND 3

(OP)
Hi!


How can i combine table column "name and surname" into one column "full name"


stafflist.dbf

column 1 = name
column 2 = surname
column 3 = the value of column 1 and 2 combine to become a full name

Thanks

RE: COLUMN 1 TABLE VALUE IS A MERGE OF COLUMN 2 AND 3

CODE

local lcFullname 

SELECT StaffList
GO TOP  
SCAN 
    SCATTER MEMVAR 
    lcFullname = ALLTRIM(m.column1) + " " + ALLTRIM(m.column2)
    replace column3 WITH lcFullname 
ENDSCAN 

GO TOP 

RE: COLUMN 1 TABLE VALUE IS A MERGE OF COLUMN 2 AND 3

Alternatively:

CODE -->

SELECT StaffList
REPLACE ALL Column3 WITH ALLTRIM(Column1) + " " + ALLTRIM(Column2) 

(This assumes that Column1, Column2 and Column3 are your actual field names. In practice, the field names would probably be something like FirstName, LastName and FullName respectively. In that case, substitute the appropriate names in the above code.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close