M
melman03
Guest
I am trying to use Access to create an A/R aging report but I am stuck. So far, I have debits and credits listed by account number and transaction date. I have created a column called 'Age' using datediff which calculates the age of the transaction, and I used the IIf function to create a field called 'Bucket', which sets the field as '0-30', '31-60', etc for each record.
At this point, I would like to subtract the total credit amount per account number from each line of debit transactions, so as to only age the
debit transactions left outstanding after the all the credits have been applied, using the First-In, First Out method.
Logically I'd like to sort the records by account number and then by age
(descending order), and use the following logic:
reference and join the following query tables:
debit transactions by account
credit totals by account
for each account number,
if debit <= total credit,
set debit = 0
set total credit = credit - debit
if total credit > 0, loop
else stop
then i would take my remaining records where debit <> 0 and use a pivot
table to classify by account number and Age bucket.
I assume I will need to write SQL code for this. Can this even be performed in Access? Since I have no SQL experience, do you have any tips on how to write this? Any help would be appreciated.
Thanks,
Melody
At this point, I would like to subtract the total credit amount per account number from each line of debit transactions, so as to only age the
debit transactions left outstanding after the all the credits have been applied, using the First-In, First Out method.
Logically I'd like to sort the records by account number and then by age
(descending order), and use the following logic:
reference and join the following query tables:
debit transactions by account
credit totals by account
for each account number,
if debit <= total credit,
set debit = 0
set total credit = credit - debit
if total credit > 0, loop
else stop
then i would take my remaining records where debit <> 0 and use a pivot
table to classify by account number and Age bucket.
I assume I will need to write SQL code for this. Can this even be performed in Access? Since I have no SQL experience, do you have any tips on how to write this? Any help would be appreciated.
Thanks,
Melody