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!

need to display part of a field

Status
Not open for further replies.

andreadd

MIS
Jan 15, 2008
67
GoldMine 6.7 SQL 2000 sp4 Crystal 2008 Visual Advantage

Hello,

I am currently upgrading our reports from CR8.5 developer to CR2008 and a formula that has worked for years in cr 8.5 doesnt appear to be doing well in the new version of crystal and I am not sure as to why.

the field is called conthist.ref

the entry that shows is like this: Sent Proposal (oc: Joe Schmoe)

here is the formula that I used to get rid of everything but Joe Schmoe

booleanvar x:= false;
numbervar st:= 0;
stringvar xref:= trim({conthist.ref});

if "(oc:" in {conthist.ref} then x := true;
st:= st + 4;
if st <2 then st :=1;

if st > length(xref) then st:= length(xref);
if x then xref := xref[st to (length(xref)-1)] else xref :=xref;
if x then xref else trim ({contact1.contact})

any ideas of what is going on or better yet an easier formula to follow? I have been using this one for so many years I have forgotten why I did it this way in the first place.

TIA for your help
 
Hi,
Try combining the InStr and Mid functions to isolate and extract the part after the : - something like

Mid(trim({conthist.ref}),Instr(trim({conthist.ref}),':') + 1)

Check the online help for details- I am not at a CR app .



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Or you could use:

if "(oc:" in {conthist.ref} then
trim(extractstring({conthist.ref},"(oc:",")"))

-LB
 
thanks so much for the help!!! lbass' formula is perfect!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top