Print Page | Close Window

Union

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10368
Printed Date: 06 May 2024 at 4:50pm


Topic: Union
Posted By: Carol
Subject: Union
Date Posted: 28 Jun 2010 at 4:15am
select D.EMPLOYEENO,
D.EMPLOYEENAME,
D.DATECOMP,
D.ACTHOURS0,
DM.DMID,
DM.DESCRIPT,
DM.EQUIPNO
from LABORAD D, DMACTIVE DM
where DM.DMID = D.DMID
UNION ALL
select HD.EMPLOYEENO,
HD.EMPLOYEENAME,
HD.DATECOMP,
HD.ACTHOURS0,
DM.DMID,
DM.DESCRIPT,
DM.EQUIPNO
from LABORHD HD, DMACTIVE DM
where DM.DMID = HD.DMHID
UNION ALL
select P.EMPLOYEENO,
P.EMPLOYEENAME,
P.DATECOMP,
P.ACTHOURS0,
PM.PMID,
PM.DESCRIPT,
PM.EQUIPNO
from LABORAP P, PMACTIVE PM
where PM.PMID = P.PMID
UNION All
select HP.EMPLOYEENO,
HP.EMPLOYEENAME,
HP.DATECOMP,
HP.ACTHOURS0,
PM.PMID,
PM.DESCRIPT,
PM.EQUIPNO
from LABORHP HP, PMACTIVE PM
where PM.PMID = HP.PMHID;
This is the query I'm using but it is only picking up 1 entry from each table.
Anyone have any ideas?
 
Thanks
 
Carol



Replies:
Posted By: Emir_W
Date Posted: 28 Jun 2010 at 8:48pm

what is the result that you require from the statement? and what is the data contains (sample data)?

have you try 'LEFT JOIN' for the link between each tables?
 
 
hope it help.
 


-------------
Emir W


Posted By: Carol
Date Posted: 29 Jun 2010 at 1:35am
Yes, the left join did the trick
 
Thank you,



Print Page | Close Window