Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search
Message
From
17/07/2008 12:39:45
 
 
To
10/07/2008 06:14:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Search
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01330151
Message ID:
01332023
Views:
14
Here is another possible solution:

Assuming you have a unique key for each person, create a table of names and unique keys

select namekey, name1 as name from yourpeopletable;
union;
select namekey, name2 as name from yourpeopletable;
union;
select namekey, name3 as name from yourpeopletable;
union;
select namekey, name4 as name from yourpeopletable;
into table allnames

parse the NameField into individual names (NameA, NameB, NameC, NameD) and then execute
one of four select statements depending on the number of names in the search field. Here
is the query for 4 names

SELECT namekey FROM allnames where name = &NameA AND namekey in (;
SELECT namekey FROM allnames WHERE name = &NameB AND namekey in (;
SELECT namekey FROM allnames WHERE name = &NameC AND namekey in (;
SELECT namekey FROM allnames WHERE name = &NameD)))
Previous
Reply
Map
View

Click here to load this message in the networking platform