Search function, one textbox

From: Angela (anon_at_email.com)
Date: 11/09/04


Date: Tue, 09 Nov 2004 08:30:31 -0800

Hi

I have a text box on a homepage that I want to use to search three
fields in the database so far I have:

Select * from Contacts
where
firstname like '%' + @SearchPhrase + '%'
or
surname like '%' + @SearchPhrase + '%'
or
company like '%' + @SearchPhrase + '%'

Which works find but when the search phrase is "Bob Harris"
then is won't return anything, as 'bob' is in firstname and 'harris' in
lastname

What's the best way to deal with the multiple search parameters?

Thanks
Angela

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!