ProlabWest
asked on
Need to limit Crystal Reports related table selection to only one record. I'm new to this app.
Ok, formulating this question may be difficult for me.
I have a mostly working report in which all data is keyed off of a field called JobN and one master table called OpenJob. There are several related tables, all linked by JobN. One of those tables, named JobStatus, has many rows with the same JobN.
When I run the report, what I WANT is one row per JobN, with data in each column as I've defined, and the maximum value of Jobstatus.StatusCode for any given JobN from the linked JobStatus table.
What I GET is multiple rows for each JobN- one for every occurence of JobN in that linked JobStatus table.
In straight SQL, I might be able to say, SELECT .... max(JobStatus.StatusCode) but I apparently can't edit a SQL statement directly in CR.
Any ideas? Does the above make sense at all? :-)
I have a mostly working report in which all data is keyed off of a field called JobN and one master table called OpenJob. There are several related tables, all linked by JobN. One of those tables, named JobStatus, has many rows with the same JobN.
When I run the report, what I WANT is one row per JobN, with data in each column as I've defined, and the maximum value of Jobstatus.StatusCode for any given JobN from the linked JobStatus table.
What I GET is multiple rows for each JobN- one for every occurence of JobN in that linked JobStatus table.
In straight SQL, I might be able to say, SELECT .... max(JobStatus.StatusCode) but I apparently can't edit a SQL statement directly in CR.
Any ideas? Does the above make sense at all? :-)
Is JobStatus.StatusCode a number/int?
Try this
Add a group to the report to group on JobN
Add a Sort on the JobStatus
In the group footer put your field for the report.
The detail section will be empty.
mlmcc
Add a group to the report to group on JobN
Add a Sort on the JobStatus
In the group footer put your field for the report.
The detail section will be empty.
mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great input all- thank you.