Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7546623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:14:50+00:00 2026-05-30T09:14:50+00:00

I have three tables in an Access DB. Labs (ID, TestLab) Standards (ID, Standard,

  • 0

I have three tables in an Access DB.

Labs (ID, TestLab)
Standards (ID, Standard, Keywords)
LabStd (ID, LabID, StdID)

A lab has many standards. Prior to today all I needed to do was match a search phrase to the keyword or standard columns in the Standards table.

Select Labs.ID, Labs.TestLab, Standards.standard
FROM Standards INNER JOIN (Labs INNER JOIN LabStd 
    ON Labs.ID = LabStd.LabID)
  ON Standards.ID = LabStd.StdID 
WHERE Standards.Keywords LIKE "%labstandard%"
OR Standards.standard LIKE "%labstandard%"
ORDER BY Labs.id, Standards.ID

Now, if a plus sign is used in the search (labstandard1+labstandard2) I need to split the string and see if a lab matches all the standards in the search. I figure I need to use a subquery for this and tried to use multiple WHERE IN statements but that doesn’t work so I’m at a loss.

As a test I removed the LIKE statements and just went to equals. The following query returns no results even though there is a matching standard for each and a lab associated with both standards.

SELECT Labs.ID, Labs.TestLab, Standards.standard
FROM Standards INNER JOIN (Labs INNER JOIN LabStd 
    ON Labs.ID = LabStd.LabID) 
ON Standards.ID = LabStd.StdID 
WHERE LabStd.StdID IN 
    (SELECT ID AS StdID FROM Standards 
     WHERE (Standards.Keywords = 'labstandard1' 
     OR Standards.standard ='labstandard1')
    ) 
AND LabStd.StdID IN 
    (SELECT ID as StdID 
     FROM Standards
     WHERE (Standards.Keywords = 'labstandard2'
            OR Standards.standard ='labstandard2')
    ) 
ORDER BY Labs.id, Standards.ID

I hope I explained that clear enough, let me know if I need to clarify anything.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:14:51+00:00Added an answer on May 30, 2026 at 9:14 am

    The problem with your last query is that you’re looking for a single LabStd row where StdId is in both subsets, and that isn’t possible. What you want is to find all the Labs for which both standards exist. Someething like this:

    SELECT 
        *
    FROM
        Labs
    WHERE
        EXISTS (
            SELECT
                1
            FROM
                LabStd INNER JOIN Standards ON LabStd.StdId = Standards.Id
            WHERE
                LabStd.LabId = Labs.Id
                AND
                ( Standards.Standard = 'labstandard1' or Standards.Keywords = 'labstandard1' )
        )
        AND
        EXISTS (
            SELECT
                1
            FROM
                LabStd INNER JOIN Standards ON LabStd.StdId = Standards.Id
            WHERE
                LabStd.LabId = Labs.Id
                AND
                ( Standards.Standard = 'labstandard2' or Standards.Keywords = 'labstandard2' )
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables in the many-to-many format. I.e, table A, B, and AB
Using Access 2010. Suppose I have three tables: dogs , cats , and catChases
I have three tables -- stores, addresses and sales. Each store has one or
I have three tables in Microsoft Access. I have a query that joins the
Well guys, I have three tables here, menu, user and access. For simplifying let's
I have two tables, each with three boolean (ms-access Yes/No) columns. Table 1: A1,
I have defined three tables, Stores, InventoryItems and StoreItemRecords. My StoreItemRecords table has foreign
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables tag , page , pagetag With the data below page
I have three tables like that: Articles IdArticle Title Content Tags IdTag TagName ContentTag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.