Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Posts
    34

    Unanswered: Query Multiple search

    I need to create a query that searches 2 out of the 5 fields. I have set the criteria to a Like "Enter Key word" but it only searches that one field. I want it to search the Title field and the Keyword field. Any suggestions?

  2. #2
    Join Date
    Apr 2004
    Posts
    173
    Could you post the query you've got so far...

  3. #3
    Join Date
    Apr 2004
    Posts
    34
    Sample form
    Attached Files Attached Files

  4. #4
    Join Date
    Apr 2004
    Posts
    173
    Sorry, could you post the SQL.

  5. #5
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    If I understand what you are trying to do, all you need to do is move both of the criteria statements onto the same row and they will act as AND criteria instead of the OR criteria that you have now.

    However,

    If you want to search both fields for the same criteria, do you want to return records that match in either field or only return records that match in both fields? What you have right now will return records where the criteria matches in either field.

    If the criteria is the same for both of the fields consider running the query from a form so the criteria only has to be entered one time.

    hope it helps.

    Steve

  6. #6
    Join Date
    Apr 2004
    Posts
    34

    SQL Statement for query

    SELECT [DOCUMENT TRACKING].[Title of Document], [DOCUMENT TRACKING].Version, [DOCUMENT TRACKING].[Locator Number], [DOCUMENT TRACKING].[Document Number], [DOCUMENT TRACKING].[Key Words], [DOCUMENT TRACKING].[Document Date], [DOCUMENT TRACKING].Author
    FROM [DOCUMENT TRACKING]
    WHERE ((([DOCUMENT TRACKING].[Title of Document]) Like "*" & [Enter Title] & "*") AND (([DOCUMENT TRACKING].[Key Words]) Like "*" & [Enter KeyWords] & "*"));

  7. #7
    Join Date
    Apr 2004
    Posts
    173
    If I understand you, I think you want to search that table to find records where the title field is like the first parameter or the key word field is like the second parameter. If you haven't tried it yet change the AND to an OR and see what happens. If this doesn't work --

    Does access prompt for both parameters when you run the query? Maybe you could post some sample results of what you're getting and what you want instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •