Results 1 to 2 of 2
  1. #1
    BigMikeM is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    1

    JOIN query with SUM function

    Hi guys n girls,

    Some background. I have multiple stores which people deposit money to. One store can have multiple deposits on the same day. I am using a StoreDate combo as a 'unique' key and a join value.
    I have built a query that joins two tables but I am only getting one value - i need to sum all the values by the StoreDate.

    Tbl_SB_Daily_ShiftTotals has a unique list of the StoreDate eg StoreX01/01/2015 (you will only see this once in this table)
    tbl_MPESA_Deposits has multiple records of deposit amounts per store per day eg StoreX01/01/2015 (this you may find as many times as people have deposited)



    Now i need to join these two tables so that the SUM of StoreX01/01/2015 (from tbl_MPESA_Deposits) is found in the single record StoreX01/01/2015 in tbl_SB_Daily_ShiftTotals

    The standard join which only brings back one value is as follows;
    As far as i know i need a select statement in here which i did and all i get it a Error: Operation must use an updateable query

    UPDATE
    tbl_SB_Daily_ShiftTotals
    INNER JOIN
    tbl_MPESA_Deposits ON tbl_SB_Daily_ShiftTotals.StoreDateJOIN = tbl_MPESA_Deposits.StoreDateJoin
    SET
    tbl_SB_Daily_ShiftTotals.MPESADeposit = [tbl_MPESA_Deposits].[PaidIn]
    WHERE
    tbl_SB_Daily_ShiftTotals.MPESADeposit Is Null
    AND tbl_MPESA_Deposits.DepositFor Like "SB";


    Any help will be appreciated.
    Thanks
    Mike

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    LIKE operator without wildcard is useless, might as well just be = sign.

    LIKE "*SB*"
    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.

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

Similar Threads

  1. Replies: 10
    Last Post: 03-20-2015, 07:15 PM
  2. Replies: 6
    Last Post: 11-19-2013, 01:38 AM
  3. Inner join query not quite right
    By coach32 in forum Queries
    Replies: 6
    Last Post: 07-07-2012, 03:13 AM
  4. Outer Join query with function not working
    By davebrads in forum Queries
    Replies: 4
    Last Post: 11-02-2011, 03:05 AM
  5. INNER JOIN to a split(array) function?
    By kman42 in forum Queries
    Replies: 8
    Last Post: 05-09-2011, 01:53 PM

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