Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL question
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00334207
Message ID:
00334951
Views:
21
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform