locked
query question - HAVING CLAUSE RRS feed

  • Question

  • User-1112204889 posted

    i need to query all the quiz topics that are not linked to task for mysql it works like so  

    SELECT 
    tbl_quiz_topics.PK_quiz_topics, 
    tbl_quiz_topics.quiz_topic, 
    tbl_quiz_topics.created_date, tbl_quiz_topics.FK_sites, 
    tbl_tasks.FK_quiz_topics 
    FROM tbl_quiz_topics 
    LEFT JOIN tbl_tasks ON tbl_quiz_topics.PK_quiz_topics = tbl_tasks.FK_quiz_topics 
    HAVING tbl_tasks.FK_quiz_topics IS NULL


    but i can't seem to convert this into ms access

    Sunday, July 18, 2010 9:57 PM

Answers

  • User-1199946673 posted

    SELECT tbl_quiz_topics.PK_quiz_topics, tbl_quiz_topics.quiz_topic, tbl_quiz_topics.created_date, tbl_quiz_topics.FK_sites, tbl_tasks.FK_quiz_topics FROM tbl_quiz_topics LEFT JOIN tbl_tasks ON tbl_quiz_topics.PK_quiz_topics = tbl_tasks.FK_quiz_topics WHERE tbl_tasks.FK_quiz_topics IS NULL

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 18, 2010 11:46 PM
  • User-1199946673 posted

    i get an error 

    'type mismatch in expression.'

     

    Then most likely tbl_quiz_topics.PK_quiz_topics and tbl_tasks.FK_quiz_topics do not have the same datatype....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 19, 2010 2:51 AM

All replies

  • User1710623990 posted

    What error you are getting in your conversion process??


    Sunday, July 18, 2010 11:30 PM
  • User-1199946673 posted

    SELECT tbl_quiz_topics.PK_quiz_topics, tbl_quiz_topics.quiz_topic, tbl_quiz_topics.created_date, tbl_quiz_topics.FK_sites, tbl_tasks.FK_quiz_topics FROM tbl_quiz_topics LEFT JOIN tbl_tasks ON tbl_quiz_topics.PK_quiz_topics = tbl_tasks.FK_quiz_topics WHERE tbl_tasks.FK_quiz_topics IS NULL

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 18, 2010 11:46 PM
  • User-1112204889 posted

    i get an error 

    'type mismatch in expression.'

    Monday, July 19, 2010 1:58 AM
  • User-1199946673 posted

    i get an error 

    'type mismatch in expression.'

     

    Then most likely tbl_quiz_topics.PK_quiz_topics and tbl_tasks.FK_quiz_topics do not have the same datatype....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 19, 2010 2:51 AM
  • User-1112204889 posted

    thanks

    yeah one was text the other was number

    Monday, July 19, 2010 2:59 AM