Taking it from another angle and assuming that the real problem is easy identification of the duplicates rather than a query about sql syntax...
This may seem like a kludge but I've done something similar and its worked pretty well for a few years!
You already have an index on
CHORPOSNUM+DTOS(DHORDJH)+STR(NHORNJH,3)
create another one but this time make it Unique.
To find dupes, you can either
set the unique index on, copy all records to a temp file in the same directory, rename the original for debugging and rename the temp file to take the place of the original file. This will eliminate duplicates in one go without the need for Rushmore. You can then examine the renamed original at your leisure to study the duplicates.
or, as part of your validation, with the unique index on, set a new (indexed) variable called, ferinstance, 'uniquerecord', to .t. as soon as the new record has been successfully added. If its a duplicate, it will be hidden by the unique index and the 'unique' variable wont be set true. At any time subsequently you can set the index to the new variable index and find all records where 'uniquerecord' is false. These are your dupes...
hope thats useful
Harry
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only