Results 1 to 4 of 4
  1. #1
    GCS is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    Swartz Creek, MI
    Posts
    10

    Access query

    I am a novice and trying to design a database to track items for a benefit auction for our Christian school and calculate rewards for classes based on what donations they bring in.



    I have an ITEMS PER STUDENT QUERY that totals the estimated value of each item brought in by each student. [SumOfEst_Value]

    I have a SPONS/ADV PER STUDENT QUERY that totals the money brought in by student through the cost of sponsorship and advertising. [SumOfCost]

    I need to add these two figures together [ITEMS PER STUDENT QUERY]![SumOfEst_Value] and [SPONS/ADV PER STUDENT QUERY]![SumOfCost] to give a total item value and spons/adv money brought in by each student. [DONATION_TOTAL]

    I was able to write the query, but the only figure showing in the [DONATION TOTAL] is for a student that had a figure for the [SumOfEst_Value] and [SumOfCost]. Most students will only have a [SumOfEst_Value]. How do I get the query to display the [SumOfEst_Value] in the [DONATION TOTAL] column for students that don't have a [SumOfCost] but also add the [SumOfEst_Value] and [SumOfCost] for those students that have both?

  2. #2
    GCS is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    Swartz Creek, MI
    Posts
    10
    I should have included that I don't know SQL and am trying to do this through query design.

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    I'm going to make a couple of assumptions here. Each Query has a Student ID or name. The 2 queries are linked on the student id or name and it's an Inner join. What that does is limit your data to Student's that exist in both queries which is the result you're getting. Assuming Query 1 is the query with the SumofEst_Value and Query 2 is the query with the SumofCost Value use a left outer join from query 1 to query 2.

  4. #4
    GCS is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    Swartz Creek, MI
    Posts
    10
    Thanks for your help, but I was able to figure it out by adding Nz to my expression which changed any null values in either queries to a 0 which fixed the problem. I appreciate your time. Thank you!

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

Similar Threads

  1. Replies: 3
    Last Post: 04-24-2012, 08:32 AM
  2. Replies: 34
    Last Post: 02-15-2012, 05:17 AM
  3. Replies: 12
    Last Post: 05-22-2011, 03:49 PM
  4. Convert Access query to SQL Server query
    By mkallover in forum Queries
    Replies: 2
    Last Post: 05-13-2011, 06:20 AM
  5. Replies: 10
    Last Post: 02-02-2011, 05:48 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