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

Returning Multiple String Records on one row

Status
Not open for further replies.

bernie321

Programmer
Jan 7, 2004
477
GB
Hi

The tables below:

Customer Table
CustomerRef PK
.....

Order Table
OrderRef PK
CustomerRef FK
StaffRef FK
......

Staff Ref is the initials of the staff member that has been dealing with the customers order.

We have a report showing each customer and the quantity of orders made this year (using a suppressed list of orders). We need to add to the list a one line value showing in order the StaffRefs of the orders made, eg:

"CSD, SAS, BDF, CHD"

I am stumped on how I can do this, any help would be much appreciated.

Thanks
B
 
You need three formulas:

//{@reset} to be placed in the customer group header:
whileprintingrecords;
stringvar staff;
if not inrepeatedgroupheader then
staff := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar staff := staff + {Order.StaffRef} + ", ";

//{@display} to be placed in the customer group footer:
whileprintingrecords;
stringvar staff;
left(staff,len(staff)-2)

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top