Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Union Post Reply Post New Topic
Author Message
Carol
Newbie
Newbie


Joined: 01 Jun 2010
Online Status: Offline
Posts: 14
Quote Carol Replybullet Topic: Union
    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
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet 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
IP IP Logged
Carol
Newbie
Newbie


Joined: 01 Jun 2010
Online Status: Offline
Posts: 14
Quote Carol Replybullet Posted: 29 Jun 2010 at 1:35am
Yes, the left join did the trick
 
Thank you,
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.