Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query on 3 fields (Access 2000)

    Please can someone help with ideas on this problem. I have a table with 4 fields: ID, Field1, field2, field3. I would like to create table that will list all the ID fields where an say "A" appear in any of the 3 fields. Currently I've got 3 queries, a union and a Unique Values Query to get to the same answer.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query on 3 fields (Access 2000)

    Like this (also see screenshot)

    SELECT ID INTO tblTarget
    FROM tblSource
    WHERE Field1 Like "*a*" OR Field2 Like "*a*" OR Field3 Like "*a*"
    Attached Images Attached Images
    • File Type: png x.png (2.6 KB, 0 views)

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query on 3 fields (Access 2000)

    Thanks

  4. #4
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query on 3 fields (Access 2000)

    How will I select unique values only. I'm looking of only the 1st instance of the ID

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query on 3 fields (Access 2000)

    Set the "Unique Values" property of the query to Yes. This corresponds to SELECT DISTINCT instead of plain SELECT in the SQL.

Posting Permissions

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