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

Problem with Like Operator 1

Status
Not open for further replies.

FastJimmy

Programmer
Jun 15, 2000
23
US
I have a table that I must search for a persons name. I have the fields nameFirst and nameLast in this table. I need to find someway to join the info for those two fields together so I can do a statement such as:

where
[full name] like '%searchValue%'

But sadly, I have no idea how to search both those fields combined info for a string.

Example: I'm search for string 'Jimmy Winter'
I can't search just the nameFirst field for that because 'Winter' is no where in it. And I can't search the nameLast field because 'Jimmy' is nowhere in it. Any help would be greatly appreciated!!

Thanks!

Jimmy
 
Just use:
...
where
nameFirst like 'xxx' and nameLast like 'yyy' John Fill
1c.bmp


ivfmd@mail.md
 
John, I tried this:

Where nameFirst like '%#form.searchValue#%' AND
nameLast like '%#form.searchValue#%'

And it returned no results. Anyone have anymore ideas?

Thanks a lot!

Jimmy
 
How about:
WHERE ([firstname] & [lastname]) Like 'searchValue'
Mike Rohde
rohdem@marshallengines.com
"If builders built buildings the way programmers wrote programs, the first woodpecker to come along would destroy civilization!"
 
try
...
where (namefirst + ' ' + namelast) like ('*' + form.searchvalue + '*') John Fill
1c.bmp


ivfmd@mail.md
 
Thanks a lot John and Mike!! Problem solved! I appreciate it!

Jimmy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top