Results 1 to 3 of 3
  1. #1
    josephw71 is offline Novice
    Windows XP Access 2013 64bit
    Join Date
    Dec 2018
    Posts
    1

    Yes no queries

    Please bear with me, I'm self taught, winging this whole thing. I work at a clinic and I need to track lab tests, not the results, just if they did them, so yes or no. There are 5 tests and I need to know if they are missing any single one of them, and which ones they have not done. So did they skip 1,2, and 4, or skip just 3. If they've done all 5 I don't care. My solution was this queries:
    test 1, 2, 3, 4, 5
    criteria f, f, f, f, f
    or f, t, t, t, t
    t, f, t, t, t
    t, t, f, t, t
    You get the idea, I hope. It works but people tend to do all there labs, or none of them, and I suspect this may not work for more complicated combinations, any ideas, suggestions?



    Forgive me if I'm not in the right forum topic or make no sense at all, and any advice is appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    can you make query Q1, to get the bad records:
    select KeyID, iif([fld1]='f' or [fld2]='f' or [fld3]='f' or [fld4]='f' or [fld5]='f',"incomplete","done") as Status from table

    then make Q2 to pull the entire record based on Q1 to see which items were not done:
    select table.* from table,Q1 where Q1.KeyID = table.KeyID and Status = 'Incomplete'"

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Alternate method...... (but not knowing what you are looking for).

    It sounds like you do not have a normalized table structure if you have fields named "test1, test2, test3, test4, test5".
    If this is your structure, you could use a form with text box controls bound to the Yes/No fields, Set the format of the text box to "Yes/No", then set conditional formatting to have a rec background if the value is False/No/0.
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 5
    Last Post: 06-05-2016, 09:23 PM
  2. queries based on union queries
    By vicsaccess in forum Queries
    Replies: 3
    Last Post: 10-10-2015, 07:53 PM
  3. Replies: 9
    Last Post: 08-27-2014, 11:34 AM
  4. Replies: 6
    Last Post: 11-13-2013, 04:17 PM
  5. sub queries
    By waqas in forum Queries
    Replies: 1
    Last Post: 02-12-2012, 07:29 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