Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What are the best indexes to have for a filter ?
Message
From
11/01/2005 10:30:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975956
Message ID:
00976040
Views:
8
>Hi Tore.
>
>Sorry for the delay in answering.
>
>The problem is that if I do not use $ and filter on Department+Section+Unit, I will end up with a huge filter string. I can't build up the filter for department, section, and unit individually.
>
>If i have the three individual indexes and then do the filter as it was originally (Department+Section+Unit $ cDepSecUnit), it still won't be good ?
>
>
>Thanks

You can easily use a variable WHERE clause, with macro substitution, i.e., the "&" sign.

For example:
lcDepartment = ThisForm.TxtDepartment.Value && i.e., based on user input
if not empty(lcWhereClause)
  lcWhereClause = "Department = " + lcDepartment
endif
...
select
  ...
  where &lcWhereClause
  ...
Combining two or more expressions with AND is a little more tricky, but perhaps this gives you the general idea.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform