Thank you very much for that little sql trick, I can sort the table, and i can see my data sorted. thanks again RHS
After the data has been sorted I placed the SELECT command onrecord event to compare the each record on my table, I can compare the first field but I can not see the comparison on the second field. I know a little idea on how to do it on the own way, but in scriptcase, i can not do this
My problem is this comparison:
I want to compare the each field record in weight and compare with the next record if their difference is <= to 30
if this is true match number will be inserted on both record field.
Then the third and the fourth record will then be compared if their difference is <= 30
if this is true then match number will be inserted on both record field, and so on.
To do this, I use the code: but only the first and the second record was compared and all filed was inserted number 1.
$sql=(“SELECT weight,match_num
FROM weight_sub_table
ORDER BY weight DESC”);
sc_lookup(ds,$sql);
$first = {ds[0][0]};
$second ={ds[1][0]};
/compute of the difference/
$diff = $first - $second;
/if statement/
if($diff <= 30 )
{
$match_num = $match_num + 1;
{ds[0][1]} = $match_num;
{ds[1][1]} = $match_num;
}
else
{
sc_alert(“needs to proceed to another record”);
exit();
}
What i really want is to have a table with this picture1 and the result will be in this picture2
I just manipulated the file.
Thanks again, please help me with this.

