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

Dispaly data from two tables 1

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
DE
I have a query like

select e.emp_name,t.tl_name from employee_details e left join tl_details t on e.emp_id=t.emp_id

A employee may have two Team leaders or may not have team leader.

Report should dispaly employee name & their tl_names.

Form the query i am getting the data like

Emp1 TL1
Emp1 TL2
Emp2 TL1
Emp3

But i want to display,

Emp1 TL1,TL2
EMp2 TL1
Emp3

Can anyone please help me out?

Thank you
 
Group on the employee field, and then create formulas like this:

//{@reset} for the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} for the detail section:
whileprintingrecords;
stringvar x := x + {t.tl_name}+",";

//{@display} for the group footer:
whileprintingrecords;
stringvar x;
if len(x)>1 then
left(x,len(x)-1)

Drag the groupname into the group footer and suppress the detail and group header sections.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top