Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record number from an index
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00429474
Message ID:
00430311
Vues:
13
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform