Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with wildcards

Status
Not open for further replies.

lushh

MIS
Sep 3, 2006
20
0
0
PH
hi guys.. i want to include a search form in my database.. here is my current SQL statement:

Code:
SELECT tblCompany.CompanyIDPK, tblCompany.CompanyName, tblCompany.CompanyAddress, tblCompany.ContactPerson, tblCompany.ContactPosition, tblCompany.OfficeNo, tblCompany.MobileNo, tblCompany.FaxNo, tblCompany.EmailAdd FROM tblCompany WHERE (((tblCompany.CompanyName)=[Forms]![frmSearchClient]![txtSearchFor]));

but this statement only returns the exact name of the company... if the name of the company in the database is ABC company and you searched for "ABC", it will return zero results... so how can i improve on this? that even if they enter only "ABC", it will return a result.

thanks a lot and good day...
 
Hi,

Check out "Like AB*"

EasyIT

EasyIT

"Do you think that’s air you're breathing?
 
Like works as follows:

AC* - finds all records that start with AC
Account
Access

*AC - finds all records that end with AC
Lilac
Prozac

*AC* - Finds all records that contain AC
Account
Access
Back
Pack
Lilac
Prozac

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
thank you for the replies... =) i'll try them.. =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top