Technical Questions
 Crystal Reports Forum : Crystal Reports 9, X, XI, 2008, 2011 : Technical Questions
Message Icon Topic: Truncate first four characters of variable string Post Reply Post New Topic
Author Message
New_Bie
Newbie
Newbie


Joined: 01 Oct 2008
Online Status: Offline
Posts: 2
Quote New_Bie Replybullet Topic: Truncate first four characters of variable string
    Posted: 01 Oct 2008 at 8:49am
I'm a Crystal novice.  I need some help to truncate the first four characters from the display of a text string.  The text string length is variable and the first four characters are always the same.

Text string example 1 in dbase is "TRE-CODE22325"
Text string example 2 in dbase is "TRE-BOR5595-RFB"
Text string example 3 in dbase is "TRE-449408"

I need remove the "TRE-" from the display of each text string.

I know there is a formula to do this, but I'm not experienced enough yet to get things to work.  Any assistance would be greatly appreciated.

Thanks.

 

IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 01 Oct 2008 at 12:33pm
You can use the MID function.  Setup a formula field called newtext (or whatever) that has the following formula:
 
MID(text string, 5, len(text string) - 4)
 
This will return a string from position 5 through the end.
 
Move newtext to your report.
 
Good luck.
 
IP IP Logged
ezeney
Newbie
Newbie
Avatar

Joined: 05 Sep 2008
Location: United States
Online Status: Offline
Posts: 14
Quote ezeney Replybullet Posted: 01 Oct 2008 at 1:20pm
MID(text string, 5) will do the same job.
IP IP Logged
New_Bie
Newbie
Newbie


Joined: 01 Oct 2008
Online Status: Offline
Posts: 2
Quote New_Bie Replybullet Posted: 02 Oct 2008 at 7:13am
Thanks.  That worked perfectly.
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.