I have a customer base table that contains a Customer number which is a string field. I found this code online and am tyring to make it founction with my tables. I want to find all the missing numbers is the table. The number start at 1 and go to just under 7000. The number go like this 1,5,6,7,9,10,11,12,15 and so on. I want the report to show a column of missing numbers example 2,3,4,8,13,14 listed in a readable format.
The code I am using is
local numbervar firstemp; // first Emp#
local numbervar nextemp; // next Emp#
local numbervar diff; // difference between firstemp and nextemp
local numbervar increase; // increment for missing Emp#'s
local numbervar result;
increase := 0;
firstemp := tonumber({customer.cus_no});
nextemp := tonumber(next({customer.cus_no}));
nextemp := nextemp -1;
diff := nextemp - firstemp;
if nextemp = firstemp
then ""
else (while diff >= 1
do (diff := diff - 1;
increase := increase + 1;
result := firstemp + increase;
exit while;);
totext (result,"00000");)
I get an error code saying,
Error in File F:\Copy of Customer Details.rpt
Error in Formula <Formula1>
'
'
The string is non-numeric
Details: errorKind
any ideas would be helpful
Regards
Darrell