Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Select only records with Maximum ID Post Reply Post New Topic
Author Message
Kwirky
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Online Status: Offline
Posts: 32
Quote Kwirky Replybullet Topic: Select only records with Maximum ID
    Posted: 23 Aug 2010 at 7:42pm
Hello,
I have a report which has 2 tables; app_quality_control and MainJobDetails.
I am trying to show a listing of all job number, whether they have had a quality control issue raised against them or not.
If a job has has quality control issues raised against it, it will increase the number of entries in the report depending on how many times the data has been updated. I have been able to show the Maximum ({app_quality_control.quality_control_id}) as the first set of records under each grouping of job number.
I want to be able to select somehow, only the records which have the maximum value, for those records with quality control issues. I still want to show all the records which have no QAs lodged.
 
So in the example below, I want to show all the records for job number 526878. For the next job, 527264, I want to only show the records which have the maximum ID, in this case 103514.
 
JobNo Quantity   Issue? quality_control_id Result
526878 1,484   No QA
526878 0   No QA
526878 0   No QA
526878 34   No QA
526878 40   No QA
526878 10   No QA
526878 630   No QA
526878 0   No QA
526878 1   No QA
526878 0   No QA
526878 15   No QA
526878 753   No QA
526878 1   No QA
527264 61   QA raised 103514   Reprint
527264 41   QA raised 103514   Reprint
527264 0   QA raised 103514   Reprint
527264 1,227   QA raised 103514   Reprint
527264 0   QA raised 103514   Reprint
527264 0   QA raised 103514   Reprint
527264 0   QA raised 103514   Reprint
527264 0   QA raised 103514   Reprint
527264 15   QA raised 103514   Reprint
527264 1,206   QA raised 103514   Reprint
527264 1   QA raised 103514   Reprint
527264 1   QA raised 103429   0
527264 15   QA raised 103429   0
527264 1,206   QA raised 103429   0
527264 0   QA raised 103429   0
527264 0   QA raised 103429   0
527264 0   QA raised 103429   0
527264 0   QA raised 103429   0
527264 0   QA raised 103429   0
527264 1,227   QA raised 103429   0
527264 61   QA raised 103429   0
527264 41   QA raised 103429   0
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2010 at 3:45am
group on job no
suppress the GH and GF
Go into the section expert
select suppress formul under the detial section and add your suppress condition there
NOT (table.qualitycontrolid=maximum(table.qualitycontrolid,table.jobno)
or isnull(table.qualitycontrolid))
 
IP IP Logged
Kwirky
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Online Status: Offline
Posts: 32
Quote Kwirky Replybullet Posted: 24 Aug 2010 at 12:12pm
Hi,
 
I have tried as you suggested and it works perfectly.
 
Thank you very much :)
 
 
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.