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

Querying for 2 terms

Status
Not open for further replies.

zigman02

IS-IT--Management
Nov 28, 2005
2
US
I need to write a query to search for up to two terms. The database I've set up has a form that pops up when the database is opened. One of the options is to search the database. I want to set it up to search up to 2 terms. For instance: suppose I'm trying to search for the term "hot soup burns". I want to be able to enter "hot", "soup", "hot soup" or "hot + burns".

The initial query I've written is as follows:

SELECT [Existing Reports].*
FROM [Existing Reports]
WHERE ucase([Existing Reports].[Product]) Like ucase([Enter Search Criteria]) & '*'
Or ucase([Existing Reports].[Report Title]) Like ucase([Enter Search Criteria]) & '*'
Or ucase([Existing Reports].[Area]) Like ucase([Enter Search Criteria]) & '*'
Or ucase([Existing Reports].[Business Owner]) Like '*' & ucase([Enter Search Criteria])
Or ucase([Existing Reports].[Summary]) Like ucase([Enter Search Criteria]) & '*';

Any ideas on the commands needed to allow for "search term 1" + "search term 2"?

Thanks
 
What would you expect if a user entered about 10 different words? Would you expect the query to return records with any of the words in any of the fields?

Do you know anything about coding in DAO?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top