Hi All
I need to get a view or query that will return 10 to 20 records. I need to sort on a field in ascending order and then in another field put a 1 , 2, 3 so forth so I know how they ranked. What I would like is suggestion on rather I should use a view or a query or what ever. I need to do this real quick because I will be doing about 20 fields and I don't really want this to be to time consuming. So does anybody know or have an an ideal of the best approach to quickly retrieve 20 records from a table, sort them and then rank them in an other field of the record. This will be of great help.
This is how I do it now. Is this a good way or is there a better way.
<code>
// Rank PowerRating
HCreateView(vwEntries, Entries, "RaceID,PowerRating,RPowerRating", "-PowerRating", "RaceID='"+parRaceID+"'", hViewLocking)
HReadFirst(vwEntries)
vnRanking = 0
WHILE NOT HOut()
// Insert your process here
IF vwEntries.PowerRating > 0 THEN vnRanking++
vwEntries.RPowerRating = vnRanking
HModify(vwEntries)
HReadNext(vwEntries)
END
HViewToFile(vwEntries)
HDeleteView(vwEntries)
</code>
Edited 1 time(s). Last edit at 12/24/2008 03:05AM by John Marrone.