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!

Greatest Date From a Parameter

Status
Not open for further replies.

bombplayer

Programmer
Jul 3, 2001
47
US
If I have a list of dates grouped by a ID number, how do I find the greatest date prior to a inputted parameter.

SalesID.Date(1/1/2001)
SalesID.Date(2/1/2001)
SalesID.Date(3/1/2001)

Parameter input 2/15/2001

How do I return the 2/1 record?
 
And without a select statement because I need all records on the report
 
If you need all of the dates to appear, how do you want to identify your target record? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Thanks for responding Ken. Actually the target record will be a indicator for another formula so that when the parameter date has been hit, it will use the date prior to the parameter date to flag a running total.
 
Write a formula:

If {date} < parameter
then {date}

and then you can use a condition that says:

{Date} = Maximum ({Formula},{Group}) Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top