Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Go bottom within a condition
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01260921
Message ID:
01260923
Views:
11
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform