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

Help with creating logic for evaluating records

Status
Not open for further replies.

tmunson99

MIS
Jun 18, 2004
62
US
I need help developing some logic for a Crystal report. My datasource is working great, but I need help in creating logic from that datasource. A sample of the data:

Id PostDate Score
1 2006-07-09 13:00:00 2
1 2006-07-01 09:30:00 3
2 2006-07-03 10:15:00 2
2 2006-06-30 12:18:00 2
3 2006-06-18 04:00:00 1
3 2006-06-01 08:13:00 3
4 2006-07-25 14:35:00 2
4 2006-07-24 12:35:00 1

My datasource contains the last two records for each Id. I need to evaluate the change in the score. In other words, on Id 1, the score went from 3 to 2. I need to evaluate that (true if there is an improvement and false if there is not) and save the result. I'm not that familiar with whilereadingrecords or arrays and, if either of these will work, how to go about using them.

Thanks for any suggestions!
 
Are higher scores better? Let's assume they are for the following.

As long as you sort or group by ID and then sort descending by date, you can place a formula like the following in the details section:

if {table.Id} = next({table.ID}) and
{table.score} > next({table.score}) then true

Not sure what you want to do after that.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top