Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for the nth Occurrence of a record
Message
De
03/08/2005 04:28:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01038056
Message ID:
01038060
Vues:
20
>I would like to search a table for a record where a paricular field equals a value and then to give me a particular value from another field. This is fine. What if I wanted to look for a particular occurence. For example the 2nd occurence or the 3rd. But not the 1st or 4th. Is this possible?
>
>Many Thanks

'Piece of cake!'
Select * from yourtable where yourcondition into cursor curdummy nofilter && Nofilter is vital!
If only_one_record_at_a_time
  Goto 2 && Second hit
  Goto 3 && Third hit
Else
  Select * from curdummy where recno()=2 or recno()=3
Endif
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform