Print Page | Close Window

Replacing Values

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20547
Printed Date: 04 May 2024 at 7:44am


Topic: Replacing Values
Posted By: BoltzGirl
Subject: Replacing Values
Date Posted: 13 Mar 2014 at 9:19am
I amusing CR v11 and have a field within a table that I need to replace the last 3 (or 4 when there is a 4th) digits with something different.
 
Example:
 
The field within the table has a number such as 12345678901C  or 12345678901CR.
 
I need to create a formula that will replace the  01C and/or the 01CR with *01
 
I think it's simple, but can't figure this one out.
 
Thanks in advance



Replies:
Posted By: kevlray
Date Posted: 13 Mar 2014 at 9:58am
I am assuming that the length of the data is fixed (12 or 13 characters long).  If not you will need a slightly different a approach.

left({field},9)+"*"+mid({field},10,2)


Posted By: BoltzGirl
Date Posted: 13 Mar 2014 at 10:46am
It was not a fixed length, so I tweaked it just a bit and it works perfectlly....Thank you so much!Smile



Print Page | Close Window