Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: surinder singh
  Where is surinder singh?
 mumbai
 India
 surinder singh
 Tags
Subject: RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS
Thread ID: 189266 Message ID: 189273 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Thursday, August 14, 2008 8:17:10 AM         
   


> > Dear All,
> >
> > I'm doing a search which has to go through a number of related fields for qualification
> > of an individual.
> >
> > from the datafile structure below
> >
> > IDNO ( C )
> > NAME ( C )
> > QUAL1 ( C )
> > QUAL2 ( C )
> > QUAL3 ( C )
> > QUAL4 ( C )
> > QUAL5 ( C )

> >
> > the system has to search through fields
> > QUAL1
> > QUAL2
> > QUAL3
> > QUAL4
> > QUAL5
> >
> > which contain information on qualifications.
> >
> >
> > QUESTION.
> >
> > 1. If I issue a search for instance for 'HND' the program should search through fields
> > QUAL1
> > QUAL2
> > QUAL3
> > QUAL4
> > QUAL5

> >
> > However 'HND' is just a substring or part of the content of the field.
> >
> > For instance field QUAL2 content is say 'MARKETING HND' for an individual.
> >
> > A program to search for say the substring 'HND' through the qualification fields
> > QUAL1
> > QUAL2
> > QUAL3
> > QUAL4
> > QUAL5

> >
> > Thanks
>
>
> 
> CREATE CURSOR qual(qual1 c(10),qual2 c(10),qual3 c(10))
> INSERT INTO qual values("qual1","qual2","qual3")
> INSERT INTO qual values("11","22","qua33")
> INSERT INTO qual values("surinder","singh","thakur")
> INSERT INTO qual values("singh","badhotra","ajay")
> 
> lcText = INPUTBOX("Enter value to search")
> 
> SELECT * FROM qual WHERE lcText$qual1 OR lcText$qual2 OR lcText$qual3
> 

>
> -----------------------------------------------------------------------------------------------
> Regards
> Surinder Singh
> Email: sur200@indiatimes.com
> Check my blog for details: http://weblogs.foxite.com/sur200
> ----------------------------------------------------------------------------------------
> *If you understand what you're doing, then you're not learning anything.


How about:
 SELECT * FROM qual WHERE (qual1+qual2+qual3) LIKE '%'+lcText+'%'

:-)
-----------------
Borislav Borissov

Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.

ENTIRE THREAD

SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by DEREK DODOO @ 8/14/2008 7:34:40 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by surinder singh @ 8/14/2008 7:47:33 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by DEREK DODOO @ 8/14/2008 8:12:29 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by surinder singh @ 8/14/2008 8:34:19 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by Borislav Borissov @ 8/14/2008 8:17:10 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by DEREK DODOO @ 8/14/2008 8:48:23 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by Borislav Borissov @ 8/14/2008 8:57:28 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by DEREK DODOO @ 8/14/2008 9:22:01 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by Borislav Borissov @ 8/14/2008 9:35:09 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by DEREK DODOO @ 8/16/2008 2:37:29 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by Stefan Wuebbe @ 8/16/2008 8:55:49 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by Jim Booth @ 8/16/2008 7:09:36 AM
RE: SEARCH FOR AN ITEM FROM A NO. OF FIELDS Posted by Anders Altberg @ 8/16/2008 6:20:38 PM