Monday, July 2, 2012

Crystal Reports : A simple use of MID()

I think a lot of new reporters get intimidated by functions like MID() and INSTR() because they try to bridge the gap between what I would consider "pure reporting" and "pure programming". But once you start, you'll find yourself reaching for these String functions again and again.

The easiest way to use MID() is:


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.

Pro Tip : More experienced reporters will know that you can actually pass two numeric parameters to MID(). The starting position, and the number of characters to "read".

So, MID({HISTORY.REF}, 5, 3), in the case of "oc: Justin Hill - Appointment" returns only "Jus".

3 comments:

Microsoft Dynamics AX training, do keep a few things in mind to get the maximum out of the course as well as the application.we teach Microsoft Dynamics AX training and class at Hyderabad. said...

Microsoft Dynamics AX training, do keep a few things in mind to get the maximum out of the course as well as the application.we teach Microsoft Dynamics AX training and class at Hyderabad.

Microsoft Dynamics AX training in Hyderabad
Microsoft Dynamics CRM training in Hyderabad
Microsoft Dynamics NAV training in Hyderabad

Microsoft Dynamics CRM training in Hyderabad said...

Microsoft Dynamics CRM training will help you manage and prioritize your business goals, customize.we teach MS Dynamics CRM training and class available at Hyderabad.

Microsoft Dynamics AX online training
Microsoft Dynamics CRM online training
Microsoft Dynamics NAV online training

aliya seen said...

I would like to appreciate your hard work you did write this post, Thanks for sharing this valuable post. programming homework service