Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find unused number in table
Message
De
08/05/2017 04:26:51
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
07/05/2017 17:56:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01650911
Message ID:
01650925
Vues:
64
>If these barcodes are to be used for commercial trade, you can't just pick any number since the number also contains a control digit.

So he can omit that digit, which then complicates the whole thing - there'd have to be a version of each code, one digit shorter, which would then be accounted for.

>Other than that, this code will find "holes" in a series
>
>
Select k.barcode+1 as missing From yourtable k;
>   Where k.barcode+1 Not in (Select barcode From yourtable)
It will find the beginning of each hole, however it won't find the size of the hole. IOW, if 20 consecutive numbers are missing, it will find the first one. But then with a fox cursor, index and Set Near ON it shouldn't be a problem to find the next existing number and gauge the size of the hole.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform