Results 1 to 4 of 4
  1. #1
    Ramtrap is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Dec 2016
    Posts
    62

    Query Results with Null Value

    Hi all,

    I've searched through various posts but can't find an answer to my question.

    I have three tables. I have a Student Table, a Quiz Table, and a Test Table.

    The Student Table has just student names and IDs. Quiz Table is connected by StudentID and Test Table by StudentID, as well.

    I want a query to show me the results of all my students so I have a query design to show:
    • FirstName (Student Table)
    • LastName (Student Table)
    • QuizScore (Quiz Table)
    • TestScore (Test Table)


    When all the information is filled in, (Mike Smith, 100 (quiz), 100 (test)) then the results will populate in my query. However, if one of them has not taken a quiz or a test, they don't show at all in the query. For example, if I had three students:


    1. Mike Smith; 100 (quiz); 100 (test)
    2. Bob Lee; <null> (quiz); 90 (test)
    3. Jennifer Myers; 95 (quiz); <null> (test)


    My query will ONLY show Mike Smith. How do I get my queries to show me everyone, to include anyone that may have a Null value in the field? I've tried criteria:
    • >=0 OR IsNull
    • >=0 OR Is Null


    Any help would be greatly appreciated. Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I assume it would be more accurate to say that there is no record in the quiz or test table, not that there's a null value? In your query, double or right-click on the join line between tables. The appropriate selection should be obvious at that point. In SQL view, that changes INNER to RIGHT or LEFT as appropriate.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You want an OUTER join. (look it up)
    This will show ALL values, null and not null.

    I think what has to happen is, when you create a Quiz, run an append query to all students in the class to post the Quiz and date (but not grade)
    grades are filled in after, and no quiz is null.

  4. #4
    Ramtrap is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Dec 2016
    Posts
    62
    This is perfect! I had just gone through an Access course and forgot all about the join types when creating queries. This helps a ton. Thank you!

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

Similar Threads

  1. Replies: 3
    Last Post: 02-22-2016, 03:38 PM
  2. Replies: 4
    Last Post: 10-13-2015, 02:29 PM
  3. Replies: 16
    Last Post: 11-24-2014, 05:23 PM
  4. Replies: 3
    Last Post: 06-04-2013, 01:23 PM
  5. Blank form on null query results
    By JackieEVSC in forum Forms
    Replies: 11
    Last Post: 11-30-2011, 08:39 AM

Tags for this Thread

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