Hello,
I am using VFP 9 to come up with a list of duplicate records in a remote view, I have this working, but I end up with a list that shows a full list of duplicates, I would like to weed this out so that it only shows me one entry per duplicate record and I am stuck trying to get this done without running too much code. Could you offer some insight as to whether this can be done within the commands to extract the data?
The way I have it setup now I end up with data that looks like this:
23308-BS/AZT 0
23308-BS/AZT 0
23308-BS/ICA 0
23308-BS/ICA 0
I will greatly appreciate your response.
*
OPEN DATABASE vpricelist
SET DATABASE TO vpricelist
*
SELECT * FROM vupload ;
WHERE model IN ;
(SELECT model ;
FROM vupload ;
GROUP BY model ;
HAVING Count(model)>1) ;
INTO ARRAY Duplicates
IF _TALLY>0
*
SELECT vupload
SELECT 2
USE chk_dup INDEX chk_dup
DELETE ALL
PACK
REINDEX
APPEND FROM ARRAY Duplicates FOR ASCAN(Duplicates,model) >0
*
EXPORT TO p:\Projects\intranet\chk_dup TYPE XL5
*
ENDIF
*
CLOSE DATABASES ALL
*
RETURN
*
I am using VFP 9 to come up with a list of duplicate records in a remote view, I have this working, but I end up with a list that shows a full list of duplicates, I would like to weed this out so that it only shows me one entry per duplicate record and I am stuck trying to get this done without running too much code. Could you offer some insight as to whether this can be done within the commands to extract the data?
The way I have it setup now I end up with data that looks like this:
23308-BS/AZT 0
23308-BS/AZT 0
23308-BS/ICA 0
23308-BS/ICA 0
I will greatly appreciate your response.
*
OPEN DATABASE vpricelist
SET DATABASE TO vpricelist
*
SELECT * FROM vupload ;
WHERE model IN ;
(SELECT model ;
FROM vupload ;
GROUP BY model ;
HAVING Count(model)>1) ;
INTO ARRAY Duplicates
IF _TALLY>0
*
SELECT vupload
SELECT 2
USE chk_dup INDEX chk_dup
DELETE ALL
PACK
REINDEX
APPEND FROM ARRAY Duplicates FOR ASCAN(Duplicates,model) >0
*
EXPORT TO p:\Projects\intranet\chk_dup TYPE XL5
*
ENDIF
*
CLOSE DATABASES ALL
*
RETURN
*