Results 1 to 5 of 5
  1. #1
    mikichi is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Oct 2013
    Posts
    45

    Dsum return wrong answer

    hi,
    i try to create a bank operations system, i have a table with this columns: nameBank, credit, duty, balance
    i want to sum all credit and reduce from duty to get the balance like in bottom/
    i try with Dsum function like that:
    Code:
    Me.balance = Dsum([credit],"bankigOperations",Me.bankName = [bankName])-Dsum(....)
    i dont know why but the first Dsum return to me wrong answer
    help plz!
    miki
    bankName duty credit balance
    bank1 3 -3
    bank2 2 2
    bank1 4 1


  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Should not save balance in table. This should be calculated in aggregate query or on report when needed.

    Textbox in report has a RunningSum property which can easily do this.
    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
    mikichi is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Oct 2013
    Posts
    45
    thank you,
    i read about runningsum and listening to your advice.
    i success to sum one column with running sum, but i dont success to reduce one column form other.
    thank you!!
    miki

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Arithmetic with null returns null. Need to handle null values.

    Try:

    =Nz([credit],0)-Nz([duty],0)
    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.

  5. #5
    mikichi is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Oct 2013
    Posts
    45
    thank you!!

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

Similar Threads

  1. Using dsum to return a cumulative total
    By tomnsd in forum Queries
    Replies: 7
    Last Post: 04-01-2013, 01:16 PM
  2. Answer abuot Combo Box
    By mojahed.mroteza in forum Access
    Replies: 5
    Last Post: 07-14-2012, 11:18 AM
  3. There should be an easy answer, Please Help.
    By tucker1003 in forum Database Design
    Replies: 3
    Last Post: 03-03-2011, 01:03 PM
  4. Getting wrong answer when comparing numbers
    By cowboy in forum Queries
    Replies: 7
    Last Post: 05-18-2010, 01:42 PM
  5. Substitute Teacher in need of answer key!
    By misssunshine1973 in forum Access
    Replies: 4
    Last Post: 05-14-2009, 02:25 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