Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help Again

Status
Not open for further replies.

nvtjellis

Programmer
Mar 6, 2001
24
US
I have batted this report around all week w/o getting it to work. What I have is a DB table w/ IDCODES (string).
The IDCODES can be 1000 - 9999. However the assignment numbers are randomly made and are not in the field called "IDCODE" until entered.
Thus, there are missing numbers in the sequence. I'm trying to find the missing numbers and print them out as a second Detail line. I inserted the EvaluateAfter() hoping it would help me get what I want.

Here is a sample of the data:
1000
1001
1002
1003
1004
1005
1006
1009

Select Recode is {IDCodes.IDCode} = "";

The sequence of the formula(s):

@Differance Note:The -1 is to make the unassigned
IDCODES the correct value.
EvaluateAfter({IDCodes.IDCode});
NumberVar Differance;
ToNumber(next({IDCodes.IDCode})) - ToNumber ({IDCodes.IDCode})-1;
===========
@CODEX
EvaluateAfter({@Differance});
If {@Differance} > 1 then
ToNumber ({IDCodes.IDCode})
else 0;
=============
@Increment
EvaluateAfter({@Codex});
Numbervar Array IdCode;
While {@Differance} > 1
Do ( Redim IdCode [{@Differance}];
(IdCode[{@Differance}]) = ({@Codex} + 1);
({@Codex}) = ({@Codex} + 1);
({@Differance}) = ({@Differance} - 1);)
================
@Unassigned IDCODES
EvaluateAfter({@Increment});
Numbervar Array IdCode;
If {@Differance} > 1 then
While {@Differance} > 1
Do (ToText (IdCode [{@Differance}] + CHR (13));
=============================================================
The output on the 2nd Detail line:
Unassigned IDCODES: ====> 1007 1008 for example.

What I get in on the 2nd line is:
@differance = 2, @CODEX = 0
@Increment = True Unassigned IDCODES = 0
 
Hello nvtjellis,
Check out thread nr 149-912093. I posted the same problem a while ago and I received a perfectly working solution from Lbass!
If you cannot search by thread # search by my handle and look for Missing numbers from a sequence subject.
Hope this will help solve your problem.

Dana
 
Dana, for future reference, if you identify a thread by adding the thread number right after the word "thread", as in thread149-912093, it will create a direct link to the thread.

-LB
 
You can also get the thread automatic link by cut-and-paste, at least on my machine.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Thank you guys.
I have tried both your solutions, but not creating the link in the edit window, I wrongly assumed that is not working. It is working in both ways!

Dana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top