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

Problem looping thru multiples 1

Status
Not open for further replies.

pdr4770

MIS
Jan 21, 2004
2
US
STRINGVAR EVENTS;
STRINGVAR EVENT;
STRINGVAR EVENT1;
STRINGVAR EVENT2;

EVENT:={AUDIT_TRAIL.act_type};
EVENT1:= NEXT({AUDIT_TRAIL.act_type});
EVENT2:= NEXT({AUDIT_TRAIL.act_type});
EVENTS:= EVENT & EVENT1 & EVENT2;

I am trying to create a surgery report in Crystal that shows surgery cases that were either booked, moved, OR re-booked on a specific date. I do not want any other types of activity. I specify this in the select and that works. The problem I am having is with the output of this data.I need the activies displayed as one field on the report. I am trying to do this by concatenating each activity. The table is AUDIT.TRAIL. The field I want is act_type. I am trying to do this using the subreport above. So, for a case that was booked, printed and then moved I need field EVENTS to have a value of "BOOKED MOVED". This seems to be working except when the case has had only 1 activity on the specified date. In this situation the EVENTS field is blank. This is only my second Crystal Report so my method might not be the best. I would appreciate any help. thanks.
 
I would group on {table.surgerycase} and then on {table.date}. Then create three formulas:

//{@reset} to be placed in the group #2 (date} header:
whileprintingrecords;
stringvar activity := "":

//{@accumacts} to be placed in the detail section:
whileprintingrecords;
stringvar activity := activity + {AUDIT_TRAIL.act_type};

//{@displayacts} to be placed in the Group #2 (date) footer:
whileprintingrecords;
stringvar activity;

I think this should work regardless of any nulls in your data.

-LB
 
sorry to take so long to respond but this did the trick. thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top