Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a table of all duplicates in a dbf file
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00445501
Message ID:
00445517
Views:
13
>Ouch! Sorry Chris.
>
>I only started using UT yesterday and I am still getting used to displaying messages in order received. I do apologize and thanks for the info you gave me.
>
>Yes I do have a unique field that I created by taking some information from 3 other fields. I then use this 'Combine' field to run a duplication check. After I create a duplicates.dbf I supply the customer with a file they can browse and make changes to. In the meantime I carry on working on the master.dbf that does not contain any of the records in the duplicates.dbf
>
>Once the customer returns the duplicates.dbf with changes I append it to the master.dbf.
>
>That is why I was asking how I would delete the records used to create the duplicates.dbf so that I have a clean unique records master.dbf
>
>I will make sure that I read the messages properly next time so that I respond to the right person.
>
>Thanks
>
>Peter

I was just kidding you < g >.

I think you can take the Duplicates table returned from the customer and do something like this, provided the records in the tables are linked by a field named ID, and the Duplicates table has a primary key on ID:


USE Master IN 0
USE Duplicates IN 0 ORDER ID EXCL

*-- Get rid of all the records the customer deleted
SELECT Duplicates
PACK

*-- For each record in the Master table, see if the corresponding record
*-- is in the Duplcates table. If so, the customer may have made changes
*-- to it, so delete the old record (the one in the Master table)
SELECT Master
SCAN
IF SEEK(ID, "Duplicates", "ID")
DELETE IN Master
ENDIF
ENDSCAN

*-- Any records the cusomter changed are added to the Master table
APPEND FROM Duplciates

Chris McCandless
Red Sky Software
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform