Results 1 to 5 of 5
  1. #1
    krutoigoga is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    20

    Sum of entries from seperate tables/queries


    Hi I'm trying to get a query to show me the SUM of entries in various fields from 2 tables/queries and compare them on a single report (line graph).
    I have created a query for each 2 tables (sum in the query summary).
    I was unsuccessful in creating a union query.
    Attached is the database - Can someone please suggest how to combine these two tables into a union query.
    Thank you.
    G.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The UNION query on tables is fine.

    You want to UNION the two Select queries? I think you want to join them so the gc SumOfPoints field becomes another field for the months. Since DRV_F Sum has all the month/year values, make the jointype 'show all records from DRV_F ...'. If it is possible for one table to have month/year that the other table doesn't, will need another table/query of all possible month/year values to join the two Sum queries to. This could be done by a Union query of the two tables to capture all possible month/year, only the date field would be in the Union.
    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
    krutoigoga is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    20
    Quote Originally Posted by June7 View Post
    The UNION query on tables is fine.

    You want to UNION the two Select queries? I think you want to join them so the gc SumOfPoints field becomes another field for the months. Since DRV_F Sum has all the month/year values, make the jointype 'show all records from DRV_F ...'. If it is possible for one table to have month/year that the other table doesn't, will need another table/query of all possible month/year values to join the two Sum queries to. This could be done by a Union query of the two tables to capture all possible month/year, only the date field would be in the Union.
    Alas .. my attempts have been unsuccessful.
    I'm trying to draw data from 2 tables. DRV_F has 10 fields with numeric values, which are entered daily. Values can be 1, 5, 10 or 50.
    Table gc has 1 filed with the same numeric values, also entered daily.
    I'm trying to retrieve a sum of each field in table DRV_F and compare to gc - individually and as a group (sum of all DRV_F fields compared to gc on a graph).
    You helped me with count - which was awesome, now im trying to drill down further.

  4. #4
    krutoigoga is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    20
    I am able to get sum of individual foelds from DRV_F and compare to the "points" field in the GC table.
    I still have not been able to combine all of the fields in DRV_F and comapre to "points" in GC.
    I cannot figure out the cross tab query.

  5. #5
    krutoigoga is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2010
    Posts
    20
    Found the problem, it was a union query issue not crosstab.

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

Similar Threads

  1. Count date entries from seperate tables/queries
    By krutoigoga in forum Queries
    Replies: 3
    Last Post: 06-30-2011, 12:48 PM
  2. Queries, using record entries only once?
    By no1beyondfan in forum Queries
    Replies: 11
    Last Post: 04-20-2011, 08:57 AM
  3. select and insert using two seperate tables
    By benjammin in forum Queries
    Replies: 2
    Last Post: 02-20-2011, 04:52 PM
  4. Replies: 3
    Last Post: 05-21-2010, 03:57 PM
  5. queries or tables?
    By ejohns in forum Reports
    Replies: 7
    Last Post: 07-27-2009, 11:31 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