Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00334207
Message ID:
00334951
Vues:
19
>>I was looking for the opposite of "USE myview NODATA", like "USE myview
>>WITHALLDATA". I wouldn't have this problem if it wasn't the the numeric field.
>>
>>I was wondering if there was a better way of doing this.
>
>Hmmmm... I can't really think of a good way off the top of my head, except for using two different views, and swapping them once you want to limit by n_length.

Actually there is a fairly simply way to this with a requery. Presumably your numeric field has a max and min value. So make the query
lc=""
ln1=minval
ln2=maxval
SELECT * FROM TABLE WHERE CHARVAR=?lc AND  numFIELD =>ln1 AND NUMFIELD =< ln2
When people narrow the range, reset the value and requery. If you don't really need a range, then have the user enters a single numeric value and store the single value in both ln1, and ln2 before querying.


The advantage of this over doing a character query is that you don't need to main an index with a string conversiion. On large files expression in indexs can be signicantly slower than just indexing on the field. If you want to see a huge differenc try a file sometime where you index on soundex vs. storing the soundex value in a field an indexing on that.
Thanks

Gar W. Lipow
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform