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

Selecting Maxium Date and couning records 1

Status
Not open for further replies.

MARTINRODDY

Programmer
Apr 3, 2001
30
US
I have a report of the following format:

Bracnh: North Street

J Bloggs

Date: Transaction:
J Bloggs 02/04/2001 L
J Bloggs 01/04/2001 W
J Bloggs 03/04/2001 L

D Smith
Date: Transaction:
D Smith 04/04/2001 L
D Smith 01/04/2001 L
D Smith 06/04/2001 W

etc.

So I have Several transactions for each customer within each branch. I wish to only display the latest record for each customer(Maximum Date) and then get a count of all the latest records for the branch. So for the above example there will only be 2 transactoions showing and the count will = 2.

What is the best approach to solving this.............I am using Crystal 7 here.


 
Group by branch and then by customer.
Sort reccords by Date Descending (this will be within the customer).

Now you can either do a distinct count summary of CUSTOMERS in each branch (which should give you the same count as counting the last transaction of each customer). Or you could create a running total field that counts the trans date, set to evaluate for each cust group and reset for each branch group. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top