I am looking for a way to remove only a portion of a string in a crystal report. The portion I want removed will always start with "EZAccess" and always end with either "AM" or "PM" but what's between that will be different every time. I want to remove everything between the "EZAccess" and "AM/PM" but leave the rest of the string intact. I've tried several different variations of the "REPLACE" function and have not been successful. Any help would be greatly appreciated. Thank you!
This worked for me. First remove the last 2 characters of the string, then replace EZaccess with blanks:
Replace (Left ({mystring},len({mystring})-2),"EZaccess" ,"" )
Thank you for your response Laura. This partly worked for me by only removing the beginning of the string I'm looking to remove. I will list an example below of what I'm trying to accomplish.
"EZAccess - Appt Confirmed on 11/16/2020 10:13 AM"
I want to remove everything in this portion of the string but the bolded section will not be the same every time. Is it possible to have the formula look for "EZAccess" and "M" and remove everything in between as well. Thank you!
The above command should have worked. Is the AM/PM always at the very end of the string? Breaking down the formula:
len({mystring})-2 counts the length of the string & subtracts 2, i.e. 48-2=46 using your string
Left ({mystring},len({mystring})-2) starting from the left of the string, keep 46 characters
Replace (Left ({mystring},len({mystring})-2),"EZaccess" ,"" ) in remaining string, replace EZaccess with blanks
I'm sorry, I don't think I'm explaining what I'm trying to do very well. That code worked but only removed the string "EZAccess" and the "AM/PM". I am wanting to remove the whole string from "EZAccess" to "AM/PM". Below is an example of an entire appointment note. I am wanting to remove the portions that say "EZAccess....AM/PM" (crossed out text) but keep everything else.
WC Ultrasound Injection. Ref from HSE. Left Shoulder DOI 08/30/2020. CF LEawood. 11/5 bam
EZAccess - Reminder Sent on 11/16/2020 12:01 AM CA!
EZAccess - Appt Confirmed on 11/16/2020 9:23 AM
Ah, I misunderstood what you were trying to do.... I don't know how to reformat the string the way you need it.