Results 1 to 4 of 4
  1. #1
    nchinnici is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2019
    Posts
    2

    Query to show all values from all tables

    I am trying to create a query to show the difference between sales projections vs. actual orders for the year. I've created a query that basically does that as shown in the screenshot.

    Click image for larger version. 

Name:	queryscreenshot.jpg 
Views:	15 
Size:	196.0 KB 
ID:	38487

    The problem is that we have instances where there was a projection for a customer but no order AND times when we get an order that was not originally projected. Neither of these values show up in the query as a record doesn't exist yet for them in either the projections or orders table. Is there any way around this, or any other way to create this type of query/report?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Probably need to use LEFT or RIGHT join instead of INNER.

    However, including multiple many relationship tables will likely produce unsatisfactory result, especially if doing aggregate calcs. Might need to use report/subreport arrangement.

    Don't do grouping in this query, do it in report. Or might need to build GROUP BY queries for Projections and Projects and join those queries to Customers.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    nchinnici is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2019
    Posts
    2
    Thanks for your feedback, I'll give your suggestions a try!

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,792
    I think the underlying flaw is that orders usually relate to customers. By relating to some other entity you have set up a situation that presupposes you can't have an order without a project. Adding custID to orders and moving the relationship to customer table may be a better long term fix.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 14
    Last Post: 03-25-2018, 01:13 PM
  2. Replies: 18
    Last Post: 03-13-2017, 12:32 PM
  3. Replies: 5
    Last Post: 03-08-2016, 07:25 AM
  4. Query to show duplicates in 3 out of 4 tables
    By figuringitout in forum Queries
    Replies: 7
    Last Post: 05-15-2015, 10:12 AM
  5. Query to show AVERAGE of all values in a field
    By taimysho0 in forum Queries
    Replies: 9
    Last Post: 01-09-2012, 11:18 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