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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have records in my database *f

Status
Not open for further replies.
Nov 28, 2002
121
US
I have records in my database

*field1 *field2 *field3 field4
S 432 R 1
S 432 R 2
P 233 F 1

This is a sample of my database where
field1 = field2 = field3 but I only want to report the record with field4 = 2 when record for field4 = 1 exists in the database. If only one record for field4 = 1 for a specific field1, field2, field3 value, I want to report that specific record.
In the ex above, I want to print out the 2nd and 3rd record.

Do I need a group selection or a record selection?
It seems very tricky.
 
Not quite sure what you mean, but it looks like you're trying to get one record (the highest number, the most recent) per field 4 within a group based on one of the other fields. If this is true, then group on {table.field1}, and use a group select statement:

{table.field4} = maximum({table.field4},{table.field1})

-LB
 
i BELIEVE i got it.

I made 4 groupings where if duplicate records were equal, I will use the maximum function to get the correct record.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top