Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to trim words up to a space? Post Reply Post New Topic
Author Message
mirakhe
Newbie
Newbie


Joined: 15 Jul 2008
Online Status: Offline
Posts: 3
Quote mirakhe Replybullet Topic: How to trim words up to a space?
     Posted: 25 Jul 2008 at 9:19am

My question is probably a very simple one for many of you, and I'm grateful for your help.

 

I want to take this:

Donald J Johnson, MD  (this is one field)

and make it look like this:

Dr. Johnson

Some people have a middle name, some dont.

Any feedback is of course appreciated.

 

 

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 25 Jul 2008 at 11:02am
Hi
 
Create the bleow formulas
 
Frm1
LEFT('Donald J Johnson, MD',InStr('Donald J Johnson, MD',','))
 
output
Donald J Johnson,
 
Frm2
output
Donald
 
Frm3
output
Johnson,
 
Frm4
output
Dr.
 
Final
output
Dr. Johnson
 
please post some more sample records so that we can check it works with all scenarios...
 
cheers
Rahul
IP IP Logged
mirakhe
Newbie
Newbie


Joined: 15 Jul 2008
Online Status: Offline
Posts: 3
Quote mirakhe Replybullet Posted: 25 Jul 2008 at 11:09am
Nice work. I should have been more specific.
 
The name itself is just an example.
The database has 340 names of different doctors.
 
It reports those into this particular record field as a "long name".
 
so for instance 
 
{qrmilestones.longname_of_alternateproviders_providers}
 
thats what spits out John J Johnson, MD
or
Mary K Walker, DO
or
Andrew Philips, MD
 
so when {qrmilestones.longname_of_alternateproviders_providers}
spits out its name, I need to get rid of everything but the last name, and throw a "Dr." in front of it.
 
Thanks!


Edited by mirakhe - 25 Jul 2008 at 11:13am
IP IP Logged
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