I Need Help: Search a line in a field

I Need Help: Search a line in a field

Post by jaime Villarroel valde » Fri, 14 Jul 1995 04:00:00



I need to search a line in a field with names (datas), the idea is show
the names that commenceing with the string that the user places when he
write char for char in a field  named "Find Name":.    

Example:    

Find Name:    _______car_______________________________ (put the name char
for char)    

Field of names:
______________________________________________________ (show the names)  
_car Mark_____________________________________________
_caro Mac_____________________________________________
_carolan jhon_________________________________________
_carolan Klen_________________________________________
_....._______________________________________________
______________________________________________________
______________________________________________________  
______________________________________________________

 
 
 

I Need Help: Search a line in a field

Post by Ken Luthe » Tue, 18 Jul 1995 04:00:00


If I understand your question correctly, all you need to do is
SET EXACT OFF and activate an index tag that is UPPER() on your
name field.  Doing a SEEK on UPPER('car') will find all the names
in your example.

--
Ken Luther
dCustom Systems Design, Inc.
71160,3707      (913)764-1606

 
 
 

I Need Help: Search a line in a field

Post by Brian Copela » Fri, 21 Jul 1995 04:00:00


J>I need to search a line in a field with names (datas), the idea is
J>show the names that commenceing with the string that the user places
J>when he write char for char in a field  named "Find Name":.    
J>    
J>Example:    
J>    
J>Find Name:    _______car_______________________________ (put the name
J>char for char)    
J>

J>  
J>    
J>Field of names:
J>______________________________________________________ (show the
J>names)    _car Mark_____________________________________________
J>_caro Mac_____________________________________________
J>_carolan jhon_________________________________________
J>_carolan Klen_________________________________________
J>_....._______________________________________________
J>______________________________________________________
J>______________________________________________________  
J>______________________________________________________

The code below shows a method of using AT() and SUBSTR() to search a
field for the occurrence of a search string and the displaying the field
starting with the character where the search string appears.


read
m.search=alltrim(m.search)
go top
scan
     m.start=at(m.search,cli_lname)
     if m.start>0
          * match is found
          ? substr(cli_lname,m.start,len(cli_lname)-m.start)
     endif
endscan


 
 
 

1. Need help with searching substrings on multiple fields

Any help will be greatly appreciated!

I've got a SQL 7 database that contains 6 address fields in one table.
 The front end has 6 corresponding lines for entering in new customer
addresses.  Users can input any relevant address text and the input is
stored in the corresponding address field.  Therefore, they end up
with this the table:

Row    Addr1             Addr2             Addr3
1      Cust. name        attn:             street
2      attn:             street addr       city
3      street addr       city              st. zip
4      street addr       city, st. zip     (NULL or space)
5      Cust. name        street addr       city, st. zip
6      street addr       city, st          zip
7      attn:             street            city

It continues through Addr5.  Addr6 is empty.  I've tried many
different ways to sort this data down to the city level.  There is no
requirement to reach the street level.  I'm at a loss due to the
randomization of strings in these fields.  I've thought about
maintaining a zip table, extract the zip string, then compare the two
to get city and state for each customer.  Any ideas or substring
syntax that will help pull down to the city level?

Thanks for any help in advance!

2. xp_readerrorlog

3. Need Help: search/replace data in one field/one record, by queries or script: PDOX5

4. Relational Association Problem (newbie)

5. Multiple field conditional search -- help needed...

6. CRW Class Library + NewEra3.0

7. Need help searching for empty date fields within an If statement

8. displaying several lines of help above a search component

9. ** HELP **Database exporting & off line searching

10. SP needs to return fields on single line

11. How to make (DB)ListBox show 2 fields per line (1 line = 1 record)

12. Help! Help needed on searching database