Joined: 21 Sep 2017
Location: United States
Online Status: Offline
Posts: 1
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.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
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.
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