Results 1 to 10 of 10
  1. #1
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153

    How to query using 3 sets of data from 3 different fields ?

    I am not sure if this is a simple or not, but hoping to find an answer.

    I am trying to run a query and here is the information i want to pull all the records that have "OMR-A" in the field "sReturnChallengeAbbr". Then of those records, i only want to pull records that meet EITHER of the following 2 criteria, it WILL NOT equal the word "Mail" in the field "szAVStatusAbbr" or it WILL equal the number "1" in the field "iUOCAVARankEmail" .



    Here is a pic of the current query (which does not work)

    Click image for larger version. 

Name:	Untitled7-25.png 
Views:	13 
Size:	26.3 KB 
ID:	29625



    When i try and run this query it pulls WAAAY more records than it should and it doesnt following the roginal criteria rule of only pulling recrods that have "OMR-A" in the field "sReturnChallengeAbbr"

    Any suggestions?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    The OMR-A should be on both lines, the Mail and 1 should be on different lines. Same line = "AND", different line = "OR".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    SO like this?

    Click image for larger version. 

Name:	Untitled7-25.png 
Views:	12 
Size:	21.2 KB 
ID:	29627

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Yes; if it works.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    Quote Originally Posted by pbaldy View Post
    Yes; if it works.
    Does not work...

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    Ill do 1 better, after quite a few rounds of testing.. this is the qry design criteria that made it work..


    Click image for larger version. 

Name:	Untitled7-25.png 
Views:	8 
Size:	22.1 KB 
ID:	29632


    this qry will search for records that do have OMR-A and will have either Not Mail OR 1 in their respective fields...

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That works and the other didn't? This should return the same result. "In" is typically used when there's a list: In("abc", "def"). In this case, with only one item it should be the same as just entering the item as you did before.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    Quote Originally Posted by pbaldy View Post
    That works and the other didn't? This should return the same result. "In" is typically used when there's a list: In("abc", "def"). In this case, with only one item it should be the same as just entering the item as you did before.

    Correct, that worked and the other did not.

    I had to write it in SQL (which im not good at) in order to figure out the design view..

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'd be curious to see the SQL of both. I'm missing something here. In any case, glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Cross Referencing two sets of data?
    By Dinger045 in forum Access
    Replies: 1
    Last Post: 10-14-2016, 10:26 AM
  2. Replies: 11
    Last Post: 09-14-2014, 04:09 PM
  3. Multiple Sets of the Same Data on 1 Report
    By rmikulas in forum Reports
    Replies: 1
    Last Post: 08-07-2012, 10:09 AM
  4. Selecting data between two sets of characters
    By rudeamy in forum Queries
    Replies: 6
    Last Post: 10-25-2011, 01:21 PM
  5. Table Fields and Sets of Records
    By kennyrogersjr in forum Access
    Replies: 2
    Last Post: 11-14-2010, 10:05 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