Click to See Complete Forum and Search --> : Formula help


gjack72
December 15th, 2005, 04:15 PM
I have a formula that looks at 1 field and I want it to give back the first number which is > 0.
It works if the first value is a 0 and the 2nd is > 0, but does not continue on if any value after the 2nd is 0. I currently have this in my details but need to put this in a group. Would that affect anything?
Any ideas??
Data: I am after record 756.00, as you can see I don't get that.

member @formula
5 0.00
Max Credit Score: 0.00
Max Credit Score: 0.00
Max Credit Score: 0.00
Max Credit Score: 0.00
Max Credit Score: 0.00
Max Credit Score: 756.00


Thanks
Glenn

Shared BooleanVar bHaveHitFirstNumber;

NumberVar sReturn;

Select bHaveHitFirstNumber
Case FALSE:
If {SCORE.CBSCORE} > 0 then
(
bHaveHitFirstNumber := TRUE;
sReturn := {SCORE.CBSCORE}
)
else
sReturn := 0
Case TRUE:
If {SCORE.CBSCORE} > 0 then
sReturn := {SCORE.CBSCORE}
else
sReturn := Next({SCORE.CBSCORE});

sReturn;