Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing double records, math problem
Message
From
16/06/2007 03:10:35
 
 
To
15/06/2007 08:54:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01233421
Message ID:
01233710
Views:
10
Lennert,
on the top of my head, dont have time to check further I would go as follows:
1st step create a temp.dbf with field(1) nRecno i, field(2) nSeqnbr i field(3) nTablnr i and all other fields from your tables 1 till 4 have
2nd step to append everything into this temp while n Recno indicates the the recno of your imported table, nTablnr a reference to your table and empty the original dbf's
3rd step fill field(2) with an atrandom number making sure this is an unique number in your temp.dbf (there is an alorgithm for this, which I can't find just this instance)
4th step sort the temp.dbf on your keyfield + nSeqnbr
5th step scan and the first recno of a 'new set' (unique nmbrs are a set of 1) is marked as .t. the remaining of that set are marked as .f.
6th step delete all for .f.
7th step reverse the remaining into your empty table1 to table4

Your whish to deleted equaly over the 4 tables according to their weight will surely end up with even if you find an alorgithm into loosing reccords due to rounding.

Good Luck, and report back if you dont find the unqiqe atrandom number generator.

Koen
Previous
Reply
Map
View

Click here to load this message in the networking platform