|
-
Mar 20th, 2000, 08:47 PM
#1
Thread Starter
New Member
I currently am working on a database program and would like to know how to search text fields to find close matches. I currently have the program to exact mactches but I would like I broader search to find exact and simlar matches. Any suggestions??
~Jeremy
-
Mar 20th, 2000, 09:21 PM
#2
Lively Member
I think this is what you are after.
This code, will return all the records that have 'ABC' anywhere within the data field.
Code:
mySearchString = "ABC"
Set myResultSet = myCon.OpenResultSet("Select myField From myTable Where UPPER(myField) Like UPPER('%" & mySearchString & "%')")
'Now you can start looping through all the records
'that contain 'ABC' within their text.
This SQL statement is for searching an SQL Server database, so you might have to alter it slightly if you are wanting to search another type of database.
The help files should tell you what wildcard to use instead of the % symbol.
(The UPPER ysntax is optional. I've used it to remove any case sensitive issues.)
Hope this helps. 
[Edited by Ishamel on 03-21-2000 at 09:22 AM]
-
Apr 19th, 2000, 01:28 AM
#3
New Member
It works!! Thanks Ishamel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|