Results 1 to 3 of 3
  1. #1
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91

    query to get data from 2 criterias


    Hi all,

    I have a query to get data from a client's address. there are 5 fields with the address lines. In the database the town names where not all entered in the correct address fields.
    this means that address_text2 and adress_text3 could have the town name. When I'm querying the database to find duplicates for the possible same client, I have no clue how to do this.
    When I use the AND, it will be checking if both fields have the same and only show those that are equal, when I use OR, then I miss the ones I need.

    As example I'm looking for all the persons that the forename starts with "M" and the Lastname is "Jones" the address_text2 is like "COR" and Adress_text3 also has like "COR"

    How to do this so I will get all address_text2 and address_text3 that has something with "Cor" in the field?

    Greetings.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    something like

    Code:
    WHERE forename like "M*" AND Lastname = "Jones" AND (address_text2 like "*COR*" OR Adress_text3 like "*COR*")

  3. #3
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91
    Hi Ajax,

    That really worked out nice, BIG thanks :-)

    Greetings.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to search for multiple criterias using comboBox?
    By AccessPractice in forum Programming
    Replies: 2
    Last Post: 04-29-2016, 03:59 AM
  2. Replies: 3
    Last Post: 05-07-2015, 10:24 AM
  3. Query based on two different criterias
    By BRZ-Ryan in forum Queries
    Replies: 11
    Last Post: 12-22-2013, 09:25 PM
  4. Replies: 19
    Last Post: 08-01-2013, 10:47 AM
  5. search a value with 2 criterias
    By Patougaffou in forum Queries
    Replies: 5
    Last Post: 07-26-2011, 10:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums