For the last formula I need on my report, this a rather long question. The task is to convert a program into Crystal. The code stores the result of a query into multiple arrays, then does some calculations on the values stored in them and prints the results. To make the question simpler, I'll only use the required arrays.
Actions[X] and Dates[X]
Actions[1] = "DTA" Dates[1] = "04/01/02"
Actions[2] = "PAY" Dates[2] = "01/01/02"
Actions[3] = "PRO" Dates[3] = "10/01/01"
Actions[4] = "PAY" Dates[4] = "07/01/01"
Actions[5] = "JRC" Dates[5] = "04/01/01"
Actions[6] = "PAY" Dates[6] = "03/01/01"
The goal is to calculate the number of months between last pay rate change when action=PAY and the currently positioned record otherwise print "No Change in Pay".
The results from the sample above should look like this:
Results[1] = "No Change in Pay"
Results[2] = "# of Months: 6"
Results[3] = "No Change in Pay"
Results[4] = "# of Months: 4"
Results[5] = "No Change in Pay"
Results[6] = "No Change in Pay"
My question is, is there a way of storing data into an array, then access it later. I used a global array to store the values (WhilePrintingRecords), then in another formula, the current record is compared to each value in the global array. However, the results I get:
Results[1] = "No Change in Pay"
Results[2] = "# of Months: 0"
Results[3] = "No Change in Pay"
Results[4] = "# of Months: 0"
Results[5] = "No Change in Pay"
Results[6] = "No Change in Pay"
I know that this occurs because even the global array is only returning the value of the current record and is not pre-storing all values.
I would greatly appreciate any pointers.
numina