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? :-)

ProlabWestAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wykabryanCommented:
Is JobStatus.StatusCode a number/int?  
mlmccCommented:
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
wykabryanCommented:
Provided StatusCode is a number the following will work.

Create a group on JobN.  Then Right Click on the StatusCode, Go to Insert>Summary.  
A box will appear (Insert Summary), the first section should have your StatusCode column name in it.  If it doesnt, pull the drop down and find your column.  Then the second section is Calculate this summary, in the drop down choose Maximum.  The final section is Summary Location (where do you want the summary to appear), choose Group #1.

So your report will look something like this:

GH1 - JobN
Detail - Suppress(to suppress, right click on the Section Name; Detail, and choose suppress)
GF1 - JobN, Maximum([StatusCode])

Hope this helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ProlabWestAuthor Commented:
Great input all- thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.