Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting TOP 5 but in reverse order
Message
From
05/07/2006 00:40:39
 
 
To
05/07/2006 00:37:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133722
Message ID:
01133724
Views:
14
>For a report (i.e., R/O), you could put the result (in the wrong order) into a cursor, and then SELECT from that cursor into a second cursor.
>
>Another option is to create a temporary index.
>
>I don't know a way to do it with just one SELECT command.

This is with OleDb, so I need to find a way to have this using one SQL. One way I have thought would be to select with the default order, thus ascending, go at the end, skip -5, get the date and do another SQL with the DESC order having a condition on the date to get only the five records I want.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform