Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    goalnightx is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2017
    Posts
    16

    The two tables were summarized by the Bkg_Sum and the Inv_Sum to create a total of all inventory by "region" (NE, WI, MN). What table would I bring into the Pos_Qry?

  2. #17
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The one that contains all of the - is it states? Expr2/3, LocSub0/RegionCode. I take it these are the same data?

  3. #18
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Didn't read your whole post, sorry! Bring in a table that contains all states, replace Products with this table in Pos_Qry and left join from it to both of these queries.

  4. #19
    goalnightx is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Correct: LocSub0 is a state abbrev field in the Inv_Sum qry and the RegionCode is state abbrev for the Bkg_Sum qry. When I join on these (along with KeyProduct) it just gives me the NE (state) data only

  5. #20
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Still working on it!

  6. #21
    goalnightx is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Ok, so I brought in a state table and joined it this way. Same result. Just gives me the "NE" stateClick image for larger version. 

Name:	Pos_Qry with ST table.JPG 
Views:	6 
Size:	47.8 KB 
ID:	27692

  7. #22
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Got it working:
    - made a new table of states, added MN,NE,WI
    - made a new query containing all products/states (SELECT PRODUCTS.KeyProduct, Table1.state FROM PRODUCTS, Table1
    - New Pos_qry:
    SELECT DISTINCT Query2.KeyProduct, Query2.state, Inv_Sum.Expr1, Bkg_Sum.Expr1, Inv_Sum.Expr2, Bkg_Sum.Expr3, Bkg_Sum.SumOfQbooked, Bkg_Sum.SumOfQconfirmd, Bkg_Sum.SumOfQrlsd, Inv_Sum.SumOfQonHand, Inv_Sum.SumOfQonHandNS, Inv_Sum.SumOfQinProgIC, Inv_Sum.SumOfQinProgOP, Inv_Sum.SumOfQinProgOther, Inv_Sum.SumOfQonHold, Inv_Sum.SumOfQavailable, Inv_Sum.SumOfQavailableNS, Inv_Sum.SumOfQavailOnSite, Inv_Sum.SumOfQavailOffSite, Inv_Sum.ProductCode AS Expr5, Inv_Sum.ProductCode AS Expr6, Inv_Sum.Expr1, Inv_Sum.Expr1
    FROM (Query2 LEFT JOIN Bkg_Sum ON (Query2.state = Bkg_Sum.Expr3) AND (Query2.KeyProduct = Bkg_Sum.Expr1)) LEFT JOIN Inv_Sum ON (Query2.state = Inv_Sum.Expr2) AND (Query2.KeyProduct = Inv_Sum.Expr1);

  8. #23
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Hate those automated emoticons!

  9. #24
    goalnightx is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2017
    Posts
    16
    any chance you could compress that and send it to me? I think I got it but I'm pretty visual..lol

  10. #25
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Sorry, no, can't do it from work. Can you copy and paste the SQL that I gave you?

  11. #26
    goalnightx is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2017
    Posts
    16
    I'm trying it now.

  12. #27
    goalnightx is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Ok, so I got the state table built and copied the SQL into Query2. It works but it is only selecting the KeyProduct = 56. (which is the one product key that I put in the zipped version of the database)

    How do I expand to select ALL KeyProducts and pickup all the records?

  13. #28
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    That's not possible! It reads all of the products on the table, look at the SQL, it does not restrict. The 56 is in your other query, not in query2.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 16
    Last Post: 06-06-2016, 08:45 AM
  2. Multiple Left Joins From Same Column
    By x0200196 in forum Access
    Replies: 1
    Last Post: 09-08-2011, 10:14 AM
  3. LEFT/RIGHT/OUTER JOINS in a set of subqueries
    By luckycharms in forum Queries
    Replies: 1
    Last Post: 08-01-2011, 05:06 PM
  4. Help With Left Joins
    By DaveyJ in forum Queries
    Replies: 23
    Last Post: 06-28-2010, 08:38 AM
  5. Examples of left joins?
    By narayanis in forum Queries
    Replies: 0
    Last Post: 06-14-2008, 06:17 AM

Tags for this Thread

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