Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Stop searching database if.... Post Reply Post New Topic
Author Message
Jelle Bijl
Newbie
Newbie


Joined: 07 Jul 2011
Online Status: Offline
Posts: 5
Quote Jelle Bijl Replybullet Topic: Stop searching database if....
     Posted: 07 Jul 2011 at 2:15am
Hi all,
 
I have a problem concerning searching a database. Fist of all, i'm a newbie. Just  finished a 2-day beginners training and before this never worked with databases before.
 
The situation: Sql database (baan IV) / CR XI.
 
Ik work for a company selling spare parts. (we have around 15.000 parts).
Now I want to create a list with parts which aren't sold the last 2 years.
 
Now this is the problem: part x is sold over a million times during the last 2 years. This means crystal goes through all these records and than concludes: yes this parts is sold in the last 2 years! But i want Crystal to stop searching the database when he found only one record showing that the part is sold.
You understand part y is also sold a million times, etc. So the report takes about 20 minutes to run.
 
I hope I make myself clear, it might be to specific for this forum, but i hope not ;-)
 
Like to hear your opinions.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Jul 2011 at 4:13am
one way would be: 
create one view for the table of sold products grouping on productid with a where cluase of the sold date > today-2 years
and outer join it to the master list of products on productid where you can select products where the view.productid is null.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum