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

Help Determining Fields within a Range and Displaying the Results

Status
Not open for further replies.

omcompany

Programmer
Aug 30, 2011
29
US
My apologies for the title, it was a hard one to summarize.

I am using CR 2008.

Here is an example of my data and what I am trying to accomplish.

({table.Weight}, {table.Time}, {table.X}, {table.Y}, {table.TimeDiff})
(100, 0 , A , 1 , 8)
(100, 25 , A , 2, 8)
(200 , 92 , B , 1, 8)
(150, 125 , B , 2, 8)
(180, 30 , B , 3, 8)
(200, 100 , B , 4, 8)
(50, 192 , B , 5, 8)

{table.TimeDiff} = 8 (the TimeDiff is set by the user)

I need to determine the maximum weight (sum if more than one record) for any record(s) that have a timing difference of {table.TimeDiff} or less.

Then I need to display the X and Y for the record(s).

I have created a formula,

//@Label
{table.X} + ToText({table.Y},0)

to use to display the results.

The report will need to look at each record, determine which ones are within the TimeDiff value, total the Weights for the results and display the @Label(s) with the maximum combined Weight.

The results from the above data should be; B1, B4

A2 and B3 meet the {table.TimeDiff} requirement but the sum of their weight is less than B1, B4.

There will be data sets where the TimeDiff is not met and a single record will be the result. The result should be @Label with the Max ({table.Weight}). If there is no Max({table.Weight}) the result should be FirstRecord({@Label}).

Thanks in advance for any assistance. The help is appreciated.
 
CoSpringGuy

No problem on the time, you are doing me the favor and I appreciate it. I am going to be off through the holidays coming and will not get back to the report until December. Any additional assistance is welcomed. Thanks again for your efforts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top