Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Selection Formula 1

Status
Not open for further replies.

mtepfer

IS-IT--Management
Apr 21, 2003
55
US
I have a report grouped by an inspection number. There are multiple types and results within each indivudal inspection. I want to show only the groups that the FIRST inspection result begins with the letter F.

Data Example:

Insp # Type Result
25 A F1
A P

35 A NE
A F1
A P

So only insp group 25 should show on the report
 
You need to explain what makes a record "first"--Is there a date field? Is the first record either the earliest date or the most recent date? Or do you have some other field that provides a sequence to the records that tells you what is "first"? Records can be sorted in different ways, changing their order, and that is why the answer to this question is important.

-LB
 
Sorry yes there is a date field. It is sorted by the earliest date first.
 
Group on {table.Insp#}. Then go to report->edit selection formula->GROUP and enter:

{table.date} = minimum({table.date},{table.Insp#}) and
{table.result} = "F1"

-LB
 
Sorry am new to this still learning Crystal.

That worked but only shows the first inspection for the group, if there are 2 or more I would still like to see them all regardless of type or result.

Thanks
 
Go to database->visual linking expert and add the table again. Link it to your first table on the Inspection # field. The new table will be called Table_1. Change your group selection formula to:

{table_1.date} = minimum({table_1.date},{table.Insp#}) and
{table_1.result} = "F1"

Leave the group on {table.Insp#} (from the first table) and display your fields based on the first table, also. The group selection formula uses the info from the first record of the alias table (Table_1) to select the groups, but displays the records from the first table.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top