Results 1 to 2 of 2
  1. #1
    warlock916 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2016
    Posts
    5

    Query handeling empty FK keys

    Hello everybody,

    I have TblAnomalie that's my main table and has many FK. Everything worked fine untill I had to add row that don't have a value for some FK as in figure.

    So when I run my query:



    SELECT TblAnomalie.IDAnomalie, TblInfoAnomalie.IDFAnomalia, TblInfoAnomalie.ExId, TblInfoAnomalie.RifProtocolloNumVerifica, TblCause.NomeAnalisiCause
    FROM TblSiti INNER JOIN (TblInfoAnomalie INNER JOIN (TblCause INNER JOIN TblAnomalie ON TblCause.IDCause = TblAnomalie.Cause_FK) ON TblInfoAnomalie.IDAnomalie = TblAnomalie.Info_FK) ON TblSiti.IDSiti = TblAnomalie.Sito_FK;

    I don't get the rows with no value, even if I use "IS Null".

    Can someone help me?

    Thanks
    Attached Thumbnails Attached Thumbnails foto 3.jpg   foto 2.jpg   foto 1.jpg  

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    In order to return records where there is no match, you have to use LEFT JOINs instead of INNER JOINs.
    See: http://www.techonthenet.com/access/queries/joins2.php

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

Similar Threads

  1. Query with Foreign Keys
    By BawdyB in forum Queries
    Replies: 5
    Last Post: 05-15-2013, 06:47 PM
  2. Replies: 2
    Last Post: 04-23-2012, 10:13 PM
  3. Replies: 4
    Last Post: 11-20-2011, 01:08 PM
  4. Handeling Multipule Units of Measure
    By Waldenbound in forum Database Design
    Replies: 1
    Last Post: 09-02-2011, 08:24 AM
  5. Short Cut Keys To Run Query
    By orcinus in forum Queries
    Replies: 5
    Last Post: 07-12-2011, 09:58 PM

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