Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Extract Part of Name Post Reply Post New Topic
Author Message
WhenF1CantHelp
Newbie
Newbie


Joined: 03 Aug 2007
Location: United States
Online Status: Offline
Posts: 10
Quote WhenF1CantHelp Replybullet Topic: Extract Part of Name
    Posted: 20 Aug 2007 at 8:14am

Field Full Name = ENTIRE NAMES

Want:
 
Field First Name = ENTIRE
Field Last Name = NAMES
 
Want to extract the first & last names.  I know there is some kind of string function that does this, don't know which one.
 
An exact function would be great but any idea of how to do this will help.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 20 Aug 2007 at 11:04pm
Try this code (I haven't tested it so there might be a small bug):
StringVar FirstName;
StringVar LastName;
FirstName := Left({table.field}, InStr({table.field}," ")-1);
LastName := Mid({table.field}, InStr({table.field}," ")+1);

I cover string functions in Chapter 6 of my new book.


Edited by BrianBischof - 20 Aug 2007 at 11:09pm
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
WhenF1CantHelp
Newbie
Newbie


Joined: 03 Aug 2007
Location: United States
Online Status: Offline
Posts: 10
Quote WhenF1CantHelp Replybullet Posted: 18 Sep 2007 at 9:20am
Thanks, did something similar and it works.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.