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!

max value problem

Status
Not open for further replies.

bardley

Programmer
May 8, 2001
121
US
I have records that consist of a date-time value along with a data value. I need to be able to pull the date-time associated with the maximum data value (not just the max value itself). How can I do this?
 
The max per group or for the whole report?
What do you want to do with the date value once you have it, just disply it or somthing else. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Actually, you've probably already half-answered my question: it's probably going to take a weird formula field in the detail section, right?
I need both--for each group, a max and min value and their dates need to be displayed (in a footer, I guess), and for the report, I need to find a global max and min and their respective dates (to be printed in the report header).
Thanx for all your help, Ken.
 
How are you with CR variables?

For the report Max you will have to initiate two variables to store a value and a date. You will replace the date and the value with the current record if the value in the current record is higher then the variable.

Another pair of variables for the minimum of the report, following a similar pattern.

For the groups you could do the same thing, and reset all four variables for each group. Or you could simply sort the group from low to high, and hide the details. Put the fileds on BOTH the GH and GF. the GH will show the minimum, the GF will show the maximum. You might even be able to underlay the GF and GH so that they print side by side. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks Ken.
Could you (or someone else) tell me where "variables" are declared? Is this in a formula? Also, where are they placed on the report? Sorry, this may be elementary, but I'm still kinda green.
Thanks loads,
bardley
 
Never mind, figured it out!!
Thanx for all the help, Ken--You da MAN!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top