Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: union command Post Reply Post New Topic
Author Message
Carol
Newbie
Newbie


Joined: 01 Jun 2010
Online Status: Offline
Posts: 14
Quote Carol Replybullet Topic: union command
     Posted: 07 Jun 2010 at 3:34am

select {LABORAD.EMPLOYEENO},{LABORAD.EMPLOYEENAME},{LABORAD.DATECOMP},{LABORAD.ACTHOURS0}
from LABORAD
UNION
select {LABORHD.EMPLOYEENO},{LABORHD.EMPLOYEENAME},{LABORHD.DATECOMP},{LABORHD.ACTHOURS0}
from LABORHD
UNION
select {LABORAP.EMPLOYEENO},{LABORAP.EMPLOYEENAME},{LABORAP.DATECOMP},{LABORAP.ACTHOURS0}
from LABORAP
UNION
select {LABORHP.EMPLOYEENO},{LABORHP.EMPLOYEENAME},{LABORHP.DATECOMP},{LABORHP.ACTHOURS0}
from LABORHP;

The command above will not work any ideas?

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Jun 2010 at 2:56am
remove the braces {}.  SQL doesn't understand them, they are part of the notation from CR, and kind of by definition, a command object is going to run before connection to the database.
 
Once you have connected to the database, there is no need of a union, as the tables are linked and you gather your data from that.
 
HTH
IP IP Logged
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