Results 1 to 3 of 3
  1. #1
    emarkman10 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    2

    Include Results with Null or Zero

    I am trying to put together a query to track customer receivables. The relevant data is in two tables: tblData and tblCash. tblData has customer info, tblCash has payment records. Each of the tables is organized by a customer number. I need a simple query to tell me the following:



    The sum of deposits, organized by customer number, and I want to input the cutoff deposit date. However, I want the results to include policies where no payment has been made. For example, if Customer XYZ placed an order on 3/1 for $50, and payment is due by 3/31, and a payment is either not made, or not made by the input date, I want the query to show a deposit of $0, rather than leaving the customer off of the results. In many cases, tblData may have the order info, but because no payment has been made, tblCash will have nothing for that customer number.

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Do this:
    1. Create a New Query & add tblData & tblCash - in that order.
    2. Click and drag the CustomerNumber from tblData to the CustomerNumber in tblCash to create a join between those fields in the two tables.
    3. Right-Click on the join line between the two tables in your query design -> Click Join Properties and select 2. Include all records from . . ..
    4. If you did that right - the join line between the two tables will have an arrow pointing to tblCash.
    5. Select CustomerID [and CustomerName ?] from tblData - and the Deposits field from tblCash.
    6. Run the Query - you should see ALL CustomerIDs [and Names if you added that field] from tblData - whether they have made any payments or not -> and the Deposits [if any]. If a customer doesn't have a deposit - you'll see a 'blank' in the Deposits field for that customer.

    Now - as far as getting the 'sum of deposits' - in the query design window - click the 'Totals' button [top of screen - just right of center] and down where your fields are - you will see a new row with 'Total:' on the left [where 'Field:' . . . Table:' etc are]. You will select 'Group By' on the CustomerID & CustomerName - and 'Sum' for the Deposits.

    I hope this helps!

  3. #3
    emarkman10 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    2
    Thank you!

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

Similar Threads

  1. Include ROW Count in Query???
    By taimysho0 in forum Queries
    Replies: 21
    Last Post: 05-25-2012, 05:29 PM
  2. Query results to include descriptions
    By funkygoorilla in forum Queries
    Replies: 4
    Last Post: 02-07-2012, 11:07 AM
  3. Null Value prevents showing any results
    By nick.h in forum Queries
    Replies: 10
    Last Post: 12-19-2011, 07:23 AM
  4. Blank form on null query results
    By JackieEVSC in forum Forms
    Replies: 11
    Last Post: 11-30-2011, 08:39 AM
  5. Only include unique occurances
    By filla_dilla in forum Queries
    Replies: 8
    Last Post: 07-18-2011, 10:22 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