×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Record Selection

Record Selection

Record Selection

(OP)
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

RE: Record Selection

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

RE: Record Selection

(OP)
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}

RE: Record Selection

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

RE: Record Selection

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

RE: Record Selection

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.

RE: Record Selection

(OP)
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

RE: Record Selection

I did specify the driver I used! pdsodbc.dll . 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

RE: Record Selection

(OP)
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

RE: Record Selection

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

RE: Record Selection

(OP)
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 ?

RE: Record Selection

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

RE: Record Selection

Try refreshing the object, hitting the Selection criteria tab, and verifying the selection criteria on the desktop.

RE: Record Selection

(OP)
Thanks everyone for great help !

RE: Record Selection

My last response was supposed to be on another thread. I think the 3rd was a buggy day.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close