SQL Select search on integer and text columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a search box where people can enter in either text or numbers. I
would like to query the SQL DB columns that are both integers and text from
just 1 search box.

Example:

SELECT * FROM faq WHERE (qa_text LIKE '%::search::%' OR qa_integer =
::search::)

The DBRW validates the query. When I enter a number in search, it finds the
qa_ID just fine. But when I enter in text in the search box, I get

Database Results Wizard Error
Description: [Microsoft][ODBC SQL Server Driver]Invalid use of default
parameter

Help
 
The simplest solution would be to change any number field that is to be searched to a text field in
the database.

The more complicated approach is that you will need to grab the input data and then parse it to
extract any numbers, then submit that as separate query.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top