Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Understanding Union All Post Reply Post New Topic
Author Message
Coreysan
Newbie
Newbie


Joined: 21 Sep 2017
Location: United States
Online Status: Offline
Posts: 1
Quote Coreysan Replybullet Topic: Understanding Union All
    Posted: 28 Sep 2017 at 6:00am
I am new to CR XI, and am looking at reports another employee wrote years ago.

In one report, there is a parameter where you can choose one or more categories to report on, from a total list of 23 categories.

When I clicked on "Show SQL Query" I was expecting to see something like 23 conditional tests, but the T-SQL I get just shows all 23 selects concatenated with the UNION ALL.

So how does CR know which select to choose?

I looked at the selection expert, and it has 7 lines:

{Command.Category} = {?Category} and
{Command.STATUS} = {?Status} and
(
    {?MyCodes} = "ALL"
    OR
    {Command.THECODE} = {?MyCodes}
)

That's it! Nothing more. No formulas, and no SQL Expression Fields.

Thanks in advance for any advice!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 28 Sep 2017 at 10:21am
The 23 selects will result in one dataset.  From that further filtering will be done with the selection expert on the that dataset.  In a sense Crystal Reports is not aware of the 23 selects, it just sees the one dataset that is returned from the command.
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.047 seconds.