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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced Search

Status
Not open for further replies.

Silvinho

Programmer
Jul 9, 2001
58
GB
When implimenting an advanced search with say first and last name, the search
doesn't include the records where the other field is blank: ie:

if I search fisrt name ='Jane'
I only get all the records where 'Jane' has a Last name.

How do I avoid this from happening.
 
I would start with checking your select statement and confirm that you're requesting both the first and last name columns. You could prolly also build an if/then statement into your select statement so that it displays even if the last name field is blank.

regards
mark
 
Hi,
try this:

SQL = "SELECT firstname, lastname FROM tablename WHERE FirstName LIKE 'Jane' OR LastName LIKE 'Jane'"

That should do it.


NightWatcher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top