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

Splitting a Field

Status
Not open for further replies.

scott1971

Technical User
Joined
Apr 20, 2005
Messages
125
Location
EU
Hopefully there's an easy answer to this but I need to split out a Title from the Member name, the title can be various characters obviously but the format is Mr John Smith, Mrs P Smith, Colonel B Mustard etc etc, can anyone tell me a simple way to do this on CR XI?
 
Code:
stringVar Array fullString := split('Mr John Smith');

stringVar title := fullString[1];
stringVar firstName := fullString[2];
stringVar lastName := fullString[3];

'Title: ' & title & chr(13) & 'First name: ' & firstName & chr(13) & 'Last name: ' & lastName;
 
The above will give:
Code:
Title: Mr
First name: John
Last name: Smith

The string in split('Mr John Smith') is to be replace by your database field.

I guess the line
stringVar title := fullString[1]
is all you'll need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top