How to apply payments against oldest balance in an AR Aging query? I have the attached dataset for which I have a query to move items into the appropriate aging buckets (Current, 31 tp 60 days, 61 to 90 days, 91 to 120 days and over 120 days) that you folks did a great job in setting up for me. I cannot seem to aportion the buckets appropriately when payments are applied to items that are in a different bucket ( i.e. as in the example of acct 37504I - if a payment made in the 61 to 90 day period, how does this get applied against a charge in the 91 to 120 day bucket?)
I have tried iif balance - net activity of the 61 to 90 day bucket > 0, Balance - (net activity of over 120) - (net activity of 90-120) - net activity of 61 to 90 days), 0.
BUT I just cannot get this to work so there has to be a FLAW in my logic and I accomplish this feat.
Your assistance is greatly appreciated.
PS - I have found a similar question posed but the zone was C Programing and there is no way I can apply to my situation...