Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for Duplicate record
Message
De
01/05/2010 15:12:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01462657
Message ID:
01462665
Vues:
100
This message has been marked as the solution to the initial question of the thread.
>tnx hilmar - works very neatly - however if there are NO duplicates - how would i prevent the query report screen from appearing?
select name, count(*) as count;
  from mydata;
  group by name;
  having count > 1;
  INTO CURSOR TEMPDUPLICATE
if _tally > 0
  MessageBox("Alert: There are duplicates.")
  browse normal
endif
Explanation: If no destination is given in an SELECT - SQL command, a cursor is automatically created, and the result is shown in a BROWSE window. If the destination is anything else (for example, a cursor which you name explicitly), it won't be shown; to see the result, you have to explicitly give a BROWSE command, or some other command to show the data.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform