Hi Turkbear,
Thanks for the reply!
I have looked at the SQL generated by Crystal, Where it is pulling all the data from database and applying filtering the data in the report. I have basically four union queries, even to pull a few records, it is reading entire query from the database, I have tried using the union's as a subquery to see if if the crystal passes where clause, but it's still grabing all data and filtering it on the report.
Any thought's on how to push where to database?
If you are creating the union query in a command, then you must also build in the selection criteria within each component of the union query if you want all work done on the server. If you instead try to add selection criteria in the Crystal GUI (report->selection formula->record), the criteria will be applied locally, after all records are returned by the command.
Sorry for the late reply LBass.
By making changes what you have suggested, I cannot pass multiple values to the sql command and cannot use "ALL" to select all the data.
Any other suggestion/workaround?
Thanks for the link LBass, But I already have a subreport, which I cannot integrate in the main report. So I can't use the approach mentioned in the FAQ.
Hi,
Look into the syntax of your database for using a CASE statement in the Where clauses...You can then pass the multiple parameters to that construction like:
where
CASE {?param} = "ALL": 1 = 1
{?param} <> "ALL" : {Table.Field} In {?param}
This is a very rough example of the idea that, in many database languages, a parameter value or values can be tested for and appropriate actions taken - that way a command can still be used for the UNION
To Paraphrase:"The Help you get is proportional to the Help you give.."
Please explain how your existing sub relates to the union command you mentioned earlier. Is the command IN the sub as its sole datasource? Or is the command used for the main report, with the sub linked to it?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.