Results 1 to 3 of 3
  1. #1
    Pawtang's Avatar
    Pawtang is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2021
    Posts
    91

    Query omitting records where FK unassigned

    I have what to me feels like a bit of a hairy problem here, but I'm sure to some of you folks will be a simple solution.



    I have a query used as the basis of a search form that searches all of my records based on a variety of optional criteria.

    In the returns process, the field failureCategory is not filled out until the part has been evaluated. So it's possible for a record to temporarily have no related value in that field. But because I reference the table tblFailureCategory to relate the name of the category to the numeric value stored in the tblPartsReturned table, this query is not returning any tblPartsReturned records where the failureCategory is not defined. When I run the query, I have ten fewer records displayed than the total amount of records in tblPartsReturned, and that's how many records in tblPartsReturned have not yet been assigned a failureCategory.

    My thought would be to establish a default value for failureCategory that acts as an undefined placeholder, with an ID of 0, and some sort of textual placeholder (or I suppose empty?) for its related text field. Is this a smart way to do this?

    Here is a view of the relationships:
    Click image for larger version. 

Name:	relationships.png 
Views:	8 
Size:	13.8 KB 
ID:	44942

    Here is the query, which was built by the design view:
    HTML Code:
    SELECT tblRMAs.RMA_nb, tblRMAs.cust_nb, tblPartsReturned.partNumber, tblRMAs.dateReceived, tblFailureCategory.failureCategory, tblPartsReturned.credit, tblRMAs.status, tblRMAs.flagFROM tblRMAs INNER JOIN (tblFailureCategory INNER JOIN tblPartsReturned ON tblFailureCategory.ID = tblPartsReturned.failureCategory) ON tblRMAs.RMA_nb = tblPartsReturned.RMA_nb;

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    Change the Join to an OUTER JOIN
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  3. #3
    Pawtang's Avatar
    Pawtang is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2021
    Posts
    91
    Quote Originally Posted by mike60smart View Post
    Hi

    Change the Join to an OUTER JOIN
    Cannot do an OUTER JOIN here but a RIGHT JOIN did the trick in the nested join

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

Similar Threads

  1. Hiding "unassigned objects"
    By Planetdune in forum Access
    Replies: 7
    Last Post: 05-25-2020, 07:20 AM
  2. Omitting multiple criteria in Design Query Mode
    By Miskondukt in forum Queries
    Replies: 6
    Last Post: 03-31-2017, 01:39 PM
  3. Omitting characters from a string
    By TonyB in forum Queries
    Replies: 4
    Last Post: 04-07-2014, 08:03 AM
  4. How to make Report omitting "Done" jobs?
    By SHogan in forum Reports
    Replies: 6
    Last Post: 02-24-2012, 06:57 PM
  5. Join - Omitting data
    By TPH in forum Queries
    Replies: 3
    Last Post: 06-07-2011, 02:05 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