title: Help with Delphi 7, ADO, & MS Access SQL Statement - Part Deuce
body: <p>I need help understanding why my SQL does not work. Or, if i need to write it differently to get the results i need.  As the title suggests, I am using Delphi 7, with ADO components, and a MS Access 2000 database.  You can see my table structure from Part I here:<br>
  <a href="https://stackoverflow.com/questions/4443152/help-with-delphi-7-ado-ms-access-sql-statement">Help with Delphi 7, ADO, &amp; MS Access SQL Statement</a>  </p>
  
  <p>The SQL i am currently using to get all knowledge based on keywords is as follows:  </p>
  
  <p>select * from (knowledge K<br>
  inner join knowledge_keywords KKW on KKW.knowledgeid = K.id)<br>
  inner join keywords KW on KW.id = KKW.keywordid<br>
  where (KW.keyword = 'job') AND (KW.keyword = 'task')  </p>
  
  <p>However, this does not return and results, when there is clearly both of those words in the knowledge_keywords table with the same knowledge id.  </p>
  
  <p>However, if i do the same SQL with an OR instead of an AND, i get the two records i expected  </p>
  
  <p>select * from (knowledge K<br>
  inner join knowledge_keywords KKW on KKW.knowledgeid = K.id)<br>
  inner join keywords KW on KW.id = KKW.keywordid<br>
  where (KW.keyword = 'job')  AND (KW.keyword = 'task')  </p>
  
  <p>thanks for any help</p>