juster21
Well-known Member
- Joined
- Jun 3, 2005
- Messages
- 867
I have a table that I am using for tracking data on a yearly basis. A record is created at the end of the year for a customer and contains Control, RenewalMonth and TerminalAmount.
The TerminalAmount is everything. It is a sum of money from each month in the year. I only calculate this value once a year, at the end of the year.
My problem/confusion is in the second year. If there is a value in the TerminalAmount (the previous years sum total) I need to add it to the sum of all months from this year and update the record.
<code>Control | RenewalMonth | TerminalAmount <br>
0123456 | 01 | $1000.00 </code>
For the example we can assume the dollar amounts are the same for each year.
So, in the second year the record for this group would look like this...
<code>Control | RenewalMonth | TerminalAmount <br>
0123456 | 01 | $2000.00 </code>
...based on the $1000 plus this years $1000.
Can I do that in 1 query or a nested query? Should I? Is the simple answer to just add an additional column and use that?
Thanks for your time on this!
The TerminalAmount is everything. It is a sum of money from each month in the year. I only calculate this value once a year, at the end of the year.
My problem/confusion is in the second year. If there is a value in the TerminalAmount (the previous years sum total) I need to add it to the sum of all months from this year and update the record.
<code>Control | RenewalMonth | TerminalAmount <br>
0123456 | 01 | $1000.00 </code>
For the example we can assume the dollar amounts are the same for each year.
So, in the second year the record for this group would look like this...
<code>Control | RenewalMonth | TerminalAmount <br>
0123456 | 01 | $2000.00 </code>
...based on the $1000 plus this years $1000.
Can I do that in 1 query or a nested query? Should I? Is the simple answer to just add an additional column and use that?
Thanks for your time on this!