I'm needing assistance with a way to only display records if a certain condition is met based on information contained in 2 tables and summarized. The 2 tables are linked by a field called acct_no. The 1st table has multiple entries for acct_no of overdue_amt based on year. The 2nd table has multiple entries for acct_no of the CVA_amt based on year and class.
Here's an example of what I'm talking about:
Table A
acct_no
year
overdue_amt
Etc.
Table B
acct_no
year
Class
CVA_amt
Etc.
I'm trying to display accts where the sum of the overdue_amt for all years is greater than 40% of the sum of the CVA_amt for a specific year.
For example
Table A
Acct_no 123456789
2010 overdue_amt: 100
2011 overdue_amt: 300
2012 overdue_amt: 500
Total overdue_amt: 900
Table B
Acct_no: 123456789
2014 CVA_amt (class1): 500
2014 CVA_amt (class2): 1000
Total 2014 CVA: 1500
Account 123456789 should be displayed in the report (sum overdue_amt(900) is greater than 40% of sum CVA_amt (600))as follows:
Acct_no............ Total Overdue_Amt .......... 2014 CVA_amt
123456789 ............... 900 .............................. 1500
Where the sum of overdue_amt is zero or less than 40% of sum CVA_amt, the record should not be displayed.
Any help would be appreciated.
Here's an example of what I'm talking about:
Table A
acct_no
year
overdue_amt
Etc.
Table B
acct_no
year
Class
CVA_amt
Etc.
I'm trying to display accts where the sum of the overdue_amt for all years is greater than 40% of the sum of the CVA_amt for a specific year.
For example
Table A
Acct_no 123456789
2010 overdue_amt: 100
2011 overdue_amt: 300
2012 overdue_amt: 500
Total overdue_amt: 900
Table B
Acct_no: 123456789
2014 CVA_amt (class1): 500
2014 CVA_amt (class2): 1000
Total 2014 CVA: 1500
Account 123456789 should be displayed in the report (sum overdue_amt(900) is greater than 40% of sum CVA_amt (600))as follows:
Acct_no............ Total Overdue_Amt .......... 2014 CVA_amt
123456789 ............... 900 .............................. 1500
Where the sum of overdue_amt is zero or less than 40% of sum CVA_amt, the record should not be displayed.
Any help would be appreciated.