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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse memo field and return multiple strings

Status
Not open for further replies.

lessn

Programmer
Feb 24, 2004
4
US
Folks,

I am trying to parse a memo field that displays audit information to output only the events that show a datetimestamp change to a field called planned end date.

When I use the following formula I only get one occurence:

Formula:
if ({table.Audit}) like ['*is the new planned end date*']
then left(({table.Audit}),21)+ totext(" is the new planned end date")

Result:
10/31/06 09:23:35 is the new planned end date

I am using Crystal Reports XI.

Below is a memo snippet. The memo grows rather large and the string can show up anywhere in it and multiple times.

9/25/06 - Vendor is on-site to work this initiative.
9/25/2006 9:21:02 AM Distributed Server

10/31/06 09:23:35 is the new planned end date.
10/02/06 09:23:43 is the new planned Start date.
9/25/2006 10:26:58 AM joeuser

10/31/06 09:23:35 is the new planned end date.
10/02/06 09:23:43 is the new planned Start date.
10/2/2006 10:40:49 AM joeuser


I would like to show like this:

10/31/06 09:23:35 is the new planned end date.
10/31/06 09:23:35 is the new planned end date.

Thanks in advance!
 
Try:

whileprintingrecords;
Stringvar Output:="";
numbervar x;
for x:= 1 to len({table.memo}) do(
if mid({Table.memo},x,21) = "new planned end date." then
Output:=Output+mid({Table.memo},x-25,21) & chr(13)
);
left(Output,len(Output)-1)

Should get ya close..

-k

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top