home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!uwm.edu!linac!uchinews!machine!chinet!les
- From: les@chinet.chi.il.us (Leslie Mikesell)
- Subject: Re: Help!-searching FOXPRO string fields
- Message-ID: <BxMFn9.266@chinet.chi.il.us>
- Organization: Chinet - Public Access UNIX
- References: <92317.100703JBC103@psuvm.psu.edu>
- Date: Thu, 12 Nov 1992 20:59:32 GMT
- Lines: 24
-
- In article <92317.100703JBC103@psuvm.psu.edu> <JBC103@psuvm.psu.edu> writes:
- >We are currently evaluating FOXPRO (for DOS-I don't think windows version is
- >out yet). One problem we're having is searching alphanumeric (string) fields.
- >We want to be able to match part of the field, ie. if the field contains
- >the words "Student address list" we may want to search for every record with
- >the word "address". In Paradox, we would search for "..address..", but we
- >haven't been able to find a similar function in Foxpro. Any help would be
- >appreciated.
-
- One way is the $ operator used as <expC1> $ <expC2> which returns true
- if <expC1> is contained in <expC2>
- LIST FOR 'address' $ lower(data_fld)
- (or LOCATE FOR, etc.)
-
- Or you can use an SQL select where _ is a single unknown character, % is
- a sequence of unknown characters:
- SELECT * ;
- FROM table;
- WHERE tabel.data_fld like "%address%";
- INTO CURSOR QUERY
- (or WHERE lower(table.data_fld) LIKE "%address%"; if you want upper/lower)
-
- Les Mikesell
- les@chinet.chi.il.us
-