Crystal Report Loop until True and Return Value

92 Views Asked by At

I have a field called "Step Number" and would like to determine the previous step. There are two tables: Work Order Step (WOS) & Route Steps (RS).

I would like to state something along these lines:

  1. Take the "Step Number" and subtract 1.
  2. Continue subtracting 1 until the Step Number from WOS is equal to a value in RS
  3. Return the value which stopped the formula

Code I have tried:

do ToNumber({WO3_WorkOrderOperationDetail.StepNumber})-1 while Not(ToNumber({WO3_WorkOrderOperationDetail.StepNumber})= ToNumber({WO_97_UDF_WORoutingLines.StepNumber}))

Also have tried to do a "result" at the end, but this is not my forte and I'm not sure what to do.

0

There are 0 best solutions below