Results 1 to 4 of 4
  1. #1
    Mikey1987 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    19

    query to return all combinations between two queries with 0 for blanks

    Hello,

    I know this is a very low level question, but google isn't working for me
    I have two subqueries that I want to link. One query calculates a person's cost and another query returns his income.
    The query I'm making should display for each person that is in the first query OR the second query, his cost & income.

    So let's say we have 3 people.
    person A is in both queries, then in the third query he will have a value for cost & income.
    Person B is only in the cost query, then in the third query he will have a value for cost, but a blank or a zero in the second colum.
    Person C is only in the income query, he will have a zero or a blank in the cost column.



    Currently, my query only returns person A. Should I perhaps first make a union query to group all possible combinations, and then link to costs & income?

    Thanks for your input!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What you want is a FULL OUTER JOIN, which unfortunately Access doesn't support. The usual workaround is the union query you describe, pulling together queries with INNER, LEFT and RIGHT joins.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Mikey1987 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Posts
    19
    Ok that makes sense. Too bad, there seem to be a lot of things access doesn't support huh

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    It's a great tool, but certainly not as powerful as SQL Server, etc.
    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. Query with Blanks and Non-Blanks
    By getalinks in forum Queries
    Replies: 14
    Last Post: 05-21-2015, 03:30 PM
  2. Replies: 1
    Last Post: 05-28-2014, 05:01 AM
  3. Need a query to figure all possible combinations
    By julestrip in forum Queries
    Replies: 1
    Last Post: 05-27-2011, 07:23 AM
  4. Query for All Possible Combinations
    By Rawb in forum Queries
    Replies: 1
    Last Post: 10-09-2010, 08:33 PM
  5. Multi-Query List Box Combinations?
    By BizIntelGuy in forum Access
    Replies: 3
    Last Post: 07-20-2010, 03:20 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