Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Selection

Status
Not open for further replies.

beginnerkid

Programmer
Jul 20, 2001
50
IN
I have following record selection formula using SI 7.0.2

{"TableName"."FieldName1"} in (?Parameter1} to (?Parameter1}
or
{"TableName"."FieldName2"} in (?Parameter1} to (?Parameter1}

When I use one of the condition, SI puts this criteria in SQL statement but when I write complete selection formula, it just flush the where clause.
Does SI 7.0.2 not support OR ?

If yes, how can I achieve the above, since there are lacs of records to read if no criteria is given in SQL. As you can see I can't use just one as it would not give all desired records
 
This may be a typo, but your paramter field should start with a '{' not a '('.

Also, why are you saying {?Parameter1} to {?Parameter1} ? Why not just = {?Parameter1}

Please advise. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
I sincerely Apologize for the typo mistakes, I should have previewed before posting. Its a classic example of Copy-n-paste mistake.

Please read as follows :

{"TableName"."FieldName1"} in {?Parameter1} to {?Parameter2}
OR
{"TableName"."FieldName2"} in {?Parameter1} to {?Parameter2}
 
That being the case I do not know why you are getting the error.

Why not make this one parameter, a range parameter, rather than 2 parameters? Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
The reason you get this is because you refer to two database fields in the same WHERE clause.

For reasons I've yet to fathom, if you refer to a database field once in a WHERE clause, then the condition is passed to the database. Further references to the same field, or the inclusion of another database field, make Crystal decide to do the processing itself - which can be quite annoying when reporting from particularly large datasets.

If your data is of a sufficient volume to make this a problem, you may do well to consider reporting off a stored procedure of SQL expression.

Naith
 
Interestingly enough, I just found that if I switched drivers to connect via odbc (pdsodbc.dll) a query like

{Orders.Required Date} in {?P1} to {?P2} or
{Orders.Order Date} in {?P1} to {?P2}

does pass to the database.
 
Naith,

I want exactly what you mentioned in last post in this thread using. I tried CR driver for Oracle7 and Micorsoft ODBC driver for Oracle, but I am still not able to do, Can you please specify which driver you used ?
Does this ability exposed by drivers ?

Thanks for your help
 
I did specify the driver I used! pdsodbc.dll [thumbsup2]. This won't be a valid driver for your database. I just used it to test on the Xtreme database.

Drivers do expose different passing styles to some extent. Notably, if you connect to Oracle via ODBC and then natively, your passes will work differently depending on your clauses.

When I originally tried with CRs Oracle7 driver, the passing was dumped like you reported.

Naith
 
Ok, Thanks very much. Just another way could be using SQL query designer. Can we remove the *.qry file once the report is built on it ? So that I can send only rpt to the installtion sites.

Thanks
Rakesh
 
Alas, you cannot do this. When you first create a report, you specify a .qry file as the datasource. In these types of reports, you do not have an option to change the database driver to an ODBC driver or to a native driver like you normally do.

This is a major drawback of using .qry files, which has been at least partially addressed in CR V9, which will take any SQL statement supported by your database, and hence no need for a separate .qry file as a datasource.

Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Thanks Dgillz !,

What I want to know is, If I create a report on .qry then once I can run my report, if I remove the .qry, would that database connection is still valid, Does CR saves all the qry information within it. since I did this, I removed qry file to different location then ran my report, sure enough report does notify that dictionary/view?? qry does not exist, proceed without it. clicking ok generates report.
It means if I create a report on qry I can just ship my rpt to producion..thats it ?

 
NO. If you create a report based on a .qry, you do not have the options of "removing" the .qry file.

The database connection is not modifiable at all. If you want to provide the user a report form either a native or ODBC connection directly rather than using a .qry file, you will need to re-write the entire report. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Try refreshing the object, hitting the Selection criteria tab, and verifying the selection criteria on the desktop.
 
My last response was supposed to be on another thread. I think the 3rd was a buggy day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top