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

Returning the latest instance of a field from a table..

Status
Not open for further replies.

ecugrad

MIS
Apr 17, 2001
191
US
Crystal 8.0

The three fields I'm using are Acctno(number), Suspended
("s" or "a") and Date(datetime). What I'm tring to do is pull a report to show all acct's that are currently suspended("s") My problem is that the Suspended field does not update from "s" to "a", it just adds another instance of the account. Example of the table:

Acctno: Suspended: Date
10555 s 10/21/01/Time
10555 a 10/21/01/Time
10555 s 10/22/01/Time
10555 a 10/22/01/Time
10555 s 10/22/01/Time

My question is how do I code or query to bring in just the accounts that are still suspended. I believe two ways would work, but I help on both.

1: By looking at the datetime field and if the last instance is an "s" that would mean the acct is still suspended.

2. If there is more "s" than "a" for an acctno the loan would be still suspended.

Hopefully, the above is understandable and thanks for any help anybody can give me on this..





 
Hi,

Add a group for your date field, and put the details in the footer or header depending on the sort order.
ie. details in footer if sort on date ascending
details in header if sort on date descending

This will just display the first or last detail within the group which should be what you are looking to achive.

Then just suppress the group section if not 's'.

Hth,
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top