Parameter Query in Crystal 
Author Message
 Parameter Query in Crystal

I have seen this question asked many times in this and other forums,
but I never see an answer. I am trying to change an existing report.
Currently there are 4 parameters being passed in and used in the
report. When I run the report the query does not use these paramaters
in the where portion of the query. It seems like it returns the whole
record set and then filters the recordset based on the parameters.
This is unacceptable because the table I am going after is very large.
What I want to do is edit the SQL query to something like this

Select ... existing query ...
Where ClientID = (PARAMETER1)
AND UserID = (PARAMETER2) etc...

The problem I have is I dont konw how to do this. What is the sytax
for including a paramater in the SQL query? I have tried many
different ways and I keep getting ODBC error : Sytax Error or Access
Violation. I am using Crystal Reports version 8.0.1.0 and MS Sql
Server 7. Please Help.

Thanks,
Shaun



Sun, 02 May 2004 00:10:04 GMT  
 Parameter Query in Crystal
Well I am about to ask for help so I guess I should give a little first:

Bare with me as this is from memory (software is at work and I'm at home):

Click on the "Select Expert".
Click on the "New" tab.
Choose the database field you want to work with (eg ClientID)
Pick the comparison operation you want (eg equals)
One or two (depending on above operation) text entry field with drop down
menus should appear.
If you press the drop down arrow in the text field all variables of the
same type as your database field should appear. So if your parameter field
is of the proper type it should show up there as {?PARAM_NAME}.

It seems that using parameters in the above way will generate the expected
where clause however if you use a formula field then Crystal selects the
whole table and filters internally (as you mentioned).

Good Luck,
Chris

PS if you wish to reply to me directly please edit my return address
appropriately.

Quote:

> I have seen this question asked many times in this and other forums,
> but I never see an answer. I am trying to change an existing report.
> Currently there are 4 parameters being passed in and used in the
> report. When I run the report the query does not use these paramaters
> in the where portion of the query. It seems like it returns the whole
> record set and then filters the recordset based on the parameters.
> This is unacceptable because the table I am going after is very large.
> What I want to do is edit the SQL query to something like this

> Select ... existing query ...
> Where ClientID = (PARAMETER1)
> AND UserID = (PARAMETER2) etc...

> The problem I have is I dont konw how to do this. What is the sytax
> for including a paramater in the SQL query? I have tried many
> different ways and I keep getting ODBC error : Sytax Error or Access
> Violation. I am using Crystal Reports version 8.0.1.0 and MS Sql
> Server 7. Please Help.

> Thanks,
> Shaun




Sat, 15 May 2004 00:03:19 GMT  
 Parameter Query in Crystal
Well I am about to ask for help so I guess I should give a little first:

Bare with me as this is from memory (software is at work and I'm at home):

Click on the "Select Expert".
Click on the "New" tab.
Choose the database field you want to work with (eg ClientID)
Pick the comparison operation you want (eg equals)
One or two (depending on above operation) text entry field with drop down
menus should appear.
If you press the drop down arrow in the text field all variables of the
same type as your database field should appear. So if your parameter field
is of the proper type it should show up there as {?PARAM_NAME}.

It seems that using parameters in the above way will generate the expected
where clause however if you use a formula field then Crystal selects the
whole table and filters internally (as you mentioned).

Good Luck,
Chris

PS if you wish to reply to me directly please edit my return address
appropriately.

Quote:

> I have seen this question asked many times in this and other forums,
> but I never see an answer. I am trying to change an existing report.
> Currently there are 4 parameters being passed in and used in the
> report. When I run the report the query does not use these paramaters
> in the where portion of the query. It seems like it returns the whole
> record set and then filters the recordset based on the parameters.
> This is unacceptable because the table I am going after is very large.
> What I want to do is edit the SQL query to something like this

> Select ... existing query ...
> Where ClientID = (PARAMETER1)
> AND UserID = (PARAMETER2) etc...

> The problem I have is I dont konw how to do this. What is the sytax
> for including a paramater in the SQL query? I have tried many
> different ways and I keep getting ODBC error : Sytax Error or Access
> Violation. I am using Crystal Reports version 8.0.1.0 and MS Sql
> Server 7. Please Help.

> Thanks,
> Shaun




Sat, 15 May 2004 00:03:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. calling parameter query from a parameter query

2. How Do I set a n ACCESS parameter query for a Crystal report

3. parameters to a sql query, used with Crystal Reports

4. Crystal Report Parameter Query/Criteria Question

5. Passing Parameters to Crystal Report 5.0 (Stored Procedure Query )

6. Crystal Report Parameter Query/Criteria Question

7. Accessing parameters in Query from Crystal Reports

8. Filling a Parameter through Code (Parameter Query)

9. Using Parameters from VBA Code in a Parameter Query Export

10. parameter query in VBA when parameter not a field

11. Using Parameter Queries with Optional Parameters

12. Parameter query w/ parameter specifying field name?

 

 
Powered by phpBB® Forum Software