Hi pips i've created the a report and i need to see the missing no between the First number and last no.i need a code to find if there's a number that is missing in that range,eg 1 to 10 and i want to see if there's a number which is not there for instance 6. :-k
0
Comments
:?: :?: :-k
http://www.BiloBeauty.com
http://www.autismspeaks.org
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I think the fastes way of figuring that out may perform slowly but it'll work (i.e. brute force it).
If you use the Incrstr (increment string function) you can loop through all of the possibile permutations of the number and make sure that they exist in your set of records.
Epimatic Corp.
http://www.epimatic.com
Thanks!! thats is what i mean and i've tried to use the INCSTR(NO.),but it looks like it gives me the next number that must in there,so how am i gonna know that there is a number missing there!!![/quote]
[Edit]
Use FINDFIRST and FINDLAST to get lower and upper bound values in the range you're checking on.
[/Edit]
Here is the code ..... O:)
Suppose you need to check the missing nos in "No." for Item table.... then
Didn't check myself ...... It should work
As Nagi said use GET if the field to be checked is Primary Key else use SETRANGE. (though I havent done that above )
Technical Consultant, MS Dynamics NAV
The above is just some pseudo code so you may have to make some changes but I think it demonstrates the idea. When the code finished the for loop the the lrCustDNE recordset (which I would define as Temporary) will have a set of all customer numbers that do not exist in your existing customer table. You should be able to apply this same logic to whatever string, number or other data you're trying to check for gaps in.
Epimatic Corp.
http://www.epimatic.com