Results 1 to 4 of 4
  1. #1
    Ultimateneo is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    19

    True/false looping only showing the false.

    Hello,



    I was wondering as i have a 1 to many relationship. I want to show only the records that fail but never pass.

    I have a serial number field and that is the 1 to many relationship, I have the pass fail as a true and false field.

    I want to show only the serial numbers that have failed and have no records of passes, for the current month and previous month.

    So what is happening is i run some tests and then fail the unit, then i makes a change and run the tests and pass or fail it depending on results.

    I would like to show only the results that have no passes in the results.

    Thank you for any help provided.

    Not sure if i can do this as a query, might have to do it as VBA.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Query should be doable. Your explanation isn't as clear as you think it is, so can you post sample data and clarify the desired result? Or just put False in your pass field criteria? I must be missing something because if it were that simple you probably wouldn't be posting this issue.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Here's my stab at it:
    Code:
    SELECT Child.ParentId 
    FROM   Child 
    WHERE  (( ( Child.TestDate ) Between DateSerial(Year(Date()), Month(Date()) - 1, 1) And DateSerial(Year(Date()), Month(Date()) + 1, 0) )) 
    GROUP  BY Child.ParentId 
    HAVING (( ( Sum(Child.Passed) ) = 0 ));  
    Given that True = -1, and False = 0, I did a summation query on the pass/fail field for all the records in the current and previous month and then selected the parent ids (serial number?) of those with a sum of zero.

  4. #4
    Ultimateneo is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    19
    Hello kd2017 looks good and seems to work i shall give it some more testing but looks good thank you

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

Similar Threads

  1. Output as yes/no NOT true/false
    By DMT Dave in forum Access
    Replies: 3
    Last Post: 12-09-2019, 02:52 PM
  2. Replies: 8
    Last Post: 10-06-2014, 03:02 PM
  3. True And False
    By azhar2006 in forum Forms
    Replies: 4
    Last Post: 12-23-2013, 03:50 AM
  4. Yes/No True/False
    By DSTR3 in forum Access
    Replies: 5
    Last Post: 12-04-2010, 05:56 PM
  5. True or false
    By tleec in forum Queries
    Replies: 1
    Last Post: 02-01-2008, 10:41 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