Results 1 to 4 of 4
  1. #1
    kloun04 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2014
    Location
    Wisconsin
    Posts
    33

    Extracting TRUE values only

    I have query that pulls in multiple fields from one table. I am trying to pull ONLY those records that are TRUE, but the simple approach for using criteria True only pulls records for that field or only the records that are in all the fields whose criteria is set to True.



    Examples of field names:
    Delirium
    Dementia
    Depression

    How do I get the query to pull only the records whose value is TRUE for each field: delirium OR dementia OR depression? As mentioned previously, if I set the criteria to True for all fields, only those records that have all three values set to True will be pulled in. I am a novice, so hopefully you can expain in easy terms.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    Your sql would be something along this pattern

    Select ..required fields.. From YourTableNameHere
    WHERE
    Dimentia = True OR
    Delirium = True OR
    Depression = True

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    In terms of the query designer if you put criteria on the same line, the query assumes you are looking for ALL of the values. So put your TRUE criteria on different rows within the criteria section. Just be aware that if you have other criteria that criteria needs to be repeated on each row or you will get unexpected results.

  4. #4
    kloun04 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2014
    Location
    Wisconsin
    Posts
    33
    Orange... that did the trick. Thank you.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-10-2012, 12:42 PM
  2. extracting data from field
    By focosi in forum Queries
    Replies: 6
    Last Post: 02-11-2012, 03:12 AM
  3. Extracting info using dlookup?
    By herbc0704 in forum Queries
    Replies: 3
    Last Post: 10-04-2011, 03:45 PM
  4. Extracting text from XML data
    By rob4465 in forum Access
    Replies: 1
    Last Post: 03-18-2010, 06:41 PM
  5. Extracting data after a keyword
    By KerryA in forum Queries
    Replies: 1
    Last Post: 02-11-2010, 09:56 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