Results 1 to 3 of 3
  1. #1
    dashiellx's Avatar
    dashiellx is offline Falconer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Baltimore
    Posts
    49

    Ignore Transactions that Balance to Zero

    I have a table that lists transactions for encounters. For example:





    As TransactionID 40717 balances out TransactionID 48355, so those should not be returned.

    I guess I need a query that will return the transaction ID of any transactions that balance out to Zero. Then I can look for transactions that are not in that query.

    Having trouble wrapping my brain round this one. I also posted this to UA. but have been unsuccessful there.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Virtually impossible. The only thing exclusively relating those two records is the amount and other records not shown could have that same amount.

    This is a rather usual requirement. Conventional approach would be just to calculate the net amount with an aggregate query.
    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
    dashiellx's Avatar
    dashiellx is offline Falconer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Baltimore
    Posts
    49
    With assistance, I was able to get this working:

    Code:
    SELECT *
    FROM (SELECT tblTechnicalDenialAdjustments.TechnicalDenialAdjustmentID, tblTechnicalDenialAdjustments.TransactionAlias, tblTechnicalDenialAdjustments.Encounter, tblTechnicalDenialAdjustments.TransactionAmount, tblTechnicalDenialAdjustments.ActivityDate
     FROM tblTechnicalDenialAdjustments)  AS sqry 
    INNER JOIN (SELECT tblTechnicalDenialAdjustments.TechnicalDenialAdjustmentID, tblTechnicalDenialAdjustments.TransactionAlias, tblTechnicalDenialAdjustments.Encounter, tblTechnicalDenialAdjustments.TransactionAmount, tblTechnicalDenialAdjustments.ActivityDate FROM tblTechnicalDenialAdjustments)  AS sqry2 
    ON (sqry.TransactionAmount = (sqry2.TransactionAmount*-1)) AND (sqry.Encounter = sqry2.Encounter);
    This appears to be returning the correct records. I will need to do some additional verification, but I think I'm at least on the right track.
    Last edited by dashiellx; 02-19-2019 at 07:47 AM. Reason: formatting

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

Similar Threads

  1. Opening balance worked into running balance.
    By Perfac in forum Programming
    Replies: 11
    Last Post: 01-09-2018, 01:20 PM
  2. Replies: 6
    Last Post: 04-17-2017, 04:47 PM
  3. Replies: 2
    Last Post: 03-26-2017, 02:41 AM
  4. Replies: 3
    Last Post: 02-03-2017, 02:37 PM
  5. General Ledger Query With Opening Balance and Running Balance
    By muhammadirfanghori in forum Queries
    Replies: 3
    Last Post: 03-12-2015, 07:17 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