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!

maximum value

Status
Not open for further replies.
Jul 21, 2001
102
US
I think this can be solved using maximum but I'm not exactly sure how. I have date and amount fields and I want the latest (most recent) amount greater than 0.

01/12/2002 1000
07/20/2002 1500
08/01/2002 0
12/05/2002 3000
01/01/2003 0

The amount I want to display is 3000 on 12/05/2002.
 
Assuming you are grouping by something, the simplest option is to select records where amount is greater than zero, sort by date, and show the last record info by showing it in the Group Footer (suppress the detail).

If you are not Grouping, do the same with the Report Footer.

A more complex approach is to create a SQL statement with subselects ensuring only the records you want to show are selected.

hth,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top