Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Go bottom within a condition
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01260921
Message ID:
01260923
Vues:
12
This message has been marked as a message which has helped to the initial question of the thread.
>In a table where I have the fields table.reg and table.ID
>
>How can I go bottom within a condition ?
>
>or
>
>How do I get the maximum table.reg for ID = 526 ?

You can't GO BOTTOM with the condition. You even GO BOTTOM or not :-)
If you wan to know what is max value for an ID you have several choices:
1. If you have an index based on ID and Reg (i.e. STR(Id)+STR(Reg) ), then you could set the order to that index DESC and seek for the ID (be sure that SET EXACT is OFF)
2. You could use SELECT:
SELECT MAX(Reg) FROM MyTable WHERE Id =526 INTO ....
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform