Wednesday, September 30, 2009

Crystal Reports : Using MID() to cut out a substring

Let us suppose that we are reporting on history, and our field {HISTORY.REF} has some annoying characters padded into the beginning of the string, like this:
"oc: Justin Hill - Appointment"
"oc: Gene Marks - Phone Call"
"oc: Corey Babka - Next Action"

For cosmetic purposes, we will create a formula to strip out the "oc:" with the following code:

Mid({HISTORY.REF}, 5)

This will return the entire string, starting at character position five.

No comments: