Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GM & Crystal: Function to start at a certain position

Status
Not open for further replies.

sharvey90

Technical User
Apr 20, 2004
18
US
GM ver. 6.0
Crystal 8.5

My report has the "Reference" field from an Activity (Sale) and I need it to only return the data that a person would actually input NOT the customer contact information.

For example, a rep. completes a sale. When running the report it displays the "reference" field as follows:

Product A (oc: John Smith)

I don't want it to display the contact name info "(oc: John Smith)" only what was typed into the "reference" field.

I need a function similar to (Left, Right or Mid) however, I'm not sure if a function will do the trick.

Any ideas? Thanks in advance.
 
wasn't the entire string "Product A (oc: John Smith)" typed into the reference field? If not what was typed in there?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
The only thing that was physically input into the reference field was "Product A". The "(oc: John Smith) is being picked up from whomever was listed as the "contact" in the "contact" field.
 
Something like this?
Code:
If  InStr ({Table1.Reference}, " (oc:" ) > 1 Then
    Left ({Table1.Reference}, InStr ({Table1.Reference}, " (oc:") - 1 )
Else
    {Table1.Reference}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top