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.

Jobs

Select record condition with 'IN' affect the speed of my report

Select record condition with 'IN' affect the speed of my report

(OP)

Hello,
I'm trying to use a select record in Crystal Report.

when I put a simple condition, I have the result quickly
{INVENTORY_PART.PART_NO} = {?PART_NO}
=> when I look at the SQL query in Crystal I have this select condition right mentionned.

when I want to use the IN condition it reduces the speed of the query
{INVENTORY_PART.PART_NO} in {?PART_NO}
=> when I look at the SQL query in Crystal I haven't this select condition mentionned => it means that Crystal reads all the records (40000 records) to select the data after (?)


I have to do a select with the IN condition because my parameter {?PART_NO} will have these data : '123344','456789','963254'

How do I improve that ?

RE: Select record condition with 'IN' affect the speed of my report

(OP)
I add to my Thread these informations :
my report is a simple label with the part number and his designation.

I've read some posts dealing with calling a sub report
Is it possible to call x times a sub report with, for each call, a parameter ?
This parameter should be a part number, belonging to the string '123344','456789','963254','999999' ?

your help would be very appreciate smile

RE: Select record condition with 'IN' affect the speed of my report

Using the IN can change the performance. It is just a result on how the query has to process the data. I do not how your main report is formatted, but if you were to group by the part number and put the sub-report in the group header, detail, or group footer, then it would call the sub-report for each part number. I do not know if the performance would be any better.

RE: Select record condition with 'IN' affect the speed of my report

I have always found the performance considerably better when using the SQL command directly (rather than letting Crystal build it). It might be worth a try.

The syntax would be something like this;

select part_no, etc, etc
from inventory_part
where inventory_part.part_no in ({?PART_NO})

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!

Resources

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