Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record number from an index
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00429474
Message ID:
00430311
Views:
12
>How about something like:
>
>lcExpr = KEY()
>lcCurVal = EVAL(lcExpr)
>COUNT TO nLogicalRecno FOR &lcExpr > lcCurVal
>
>I don't know how this might fit into your application, but I tried this on a >750000 record file and, in the command window, got virtually instantaneous >response.


If the record set is small enough this seems fine. However, if you're working with views, this won't really work. Another option I thought about if the list is not reasonably distributed between A-Z (or whatever) is to create a summary view when the form inits and then use your above calculation on that.

Select padr(upper(lastname),2) as lastname, count(*) as count from table group by 1

Then instead of your count,

calculate sum(count) to nrecordspassed for lastname<=upper(left(table.lastname,2))

this is only on on a few hundred records, so it should be fast and even work with a diffen't backend.
Previous
Reply
Map
View

Click here to load this message in the networking platform