Results 1 to 3 of 3
  1. #1
    SummerCampGuy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    6

    Queries using"is not null" in 4 different fields

    Hi all,

    Please bear with me if I am posting wrong as this is my first question post.
    I am building a database for my summer camp and I am running into an issue. The end result I am looking for is a query that shows campers with 1 or more of 4 different issue and I want to see just those campers.
    I have 4 fields that are Meds, Allergies, Diet and Health Alerts. I need to see campers with stuff in those fields except a camper might have something in 1 of the fields but not all 4.

    Joey Camper has Meds and Allergies and Suzi Camper has Health Alerts and Meds. I was putting "Is Not Null" in the criteria field in all 4 of those fields but no one is showing up because they only have something in 2 of the fields.

    Even if they have something in just ONE of them, I need to see them. I am stuck and I really would appreciate any help.
    Thanks so much!!



    I think I have a different issue too. I need a query that I can do this by cabin. Under the Criteria in the cabin field, I used [Which Cabin?] So when I run the query, I enter a cabin number and campers from that cabin come up.

    What I need is a query that when I run it, it asks me the cabin, I put in a cabin number and it will show ONLY the record that have something in at least 1 of those other 4 fields.

    I thought I had it with a Union Query, but that is not working at all. So frustrating.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Consider:

    SELECT ID, Meds, Allergies, Diet, Health, Cabin
    FROM Table1
    WHERE Cabin=[Enter Cabin] AND (Not Meds Is Null OR Not Allergies Is Null OR Not Diet Is Null OR Not Health Is Null);
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    SummerCampGuy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    6
    Welp, you are pretty much amazing!

    Thank you so so so much!! You saved the day!

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

Similar Threads

  1. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  2. Replies: 4
    Last Post: 01-22-2015, 10:30 AM
  3. Replies: 3
    Last Post: 11-13-2013, 08:56 AM
  4. Replies: 1
    Last Post: 12-28-2012, 02:54 PM
  5. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM

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