Results 1 to 3 of 3
  1. #1
    jaarons is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    22

    Queries using IIF statements

    Hi everyone,

    I have a query that takes student names, allergies and medication from their student records. I want to tell access to include in the query only those records that have something EITHER in the alergies field OR in the medication fields from my Students table. Otherwise (if they don't) don't include them.

    Thanks!

    (That's the easier question, I'm now going to post a harder one . . .)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try criteria of Not Is Null under each field but on separate criteria rows.
    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
    jaarons is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    22
    Worked a treat. Thanks June!

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

Similar Threads

  1. IIF Statements and Update Queries.
    By nicknicknick in forum Queries
    Replies: 1
    Last Post: 06-05-2011, 12:08 PM
  2. If statements
    By swagger18 in forum Programming
    Replies: 6
    Last Post: 01-28-2011, 08:13 PM
  3. IIF statements?
    By staceyo in forum Queries
    Replies: 15
    Last Post: 09-28-2010, 08:45 AM
  4. SQL statements from VBA
    By John Southern in forum Programming
    Replies: 12
    Last Post: 05-16-2010, 01:07 PM
  5. IIF Statements
    By JDA2005 in forum Queries
    Replies: 8
    Last Post: 07-07-2009, 04:24 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