I’m having trouble using MS Access 2003 to accomplish something that I thought would be relatively easy: I’m trying to create a query [not a report] that will give me the projected balance of an account (such as a 401K account) at each year in the future, which is growing at a fixed rate of X% a year and which also gets additional, lump sum contributions each year.
For example, let’s assume you start with a balance of zero and have these annual contributions, which for the sake of argument are obtainable via a table or query:
Year Contribution (at year end)
2009 $100
2010 $125
2011 $150
2012 $175
…
I’m trying to create another query, using that first query as my data source, which would return the following results, assuming a fixed rate of 10% growth per year:
Year Balance (at year end)
2009 $100
2010 $235 [which is $100*1.10 + 125]
2011 $408.50 [which is $235*1.10 + 150]
2012 $624.35 [which is $408.50*1.10 + 175]
…
I’m not really an Access superhero nor SQL/VB guy, but after surfing the blogs, I have tried hacking around with Public Functions, Global Variables, DSUM, embedded Selects, etc., and I just haven’t been be able to figure out a solution [call me stupid!] Any help or advice would be severely appreciated!
P.S. Like many things in Access, there's probably several ways to skin this cat - I just need one! I think I could pull it off if I could figure out how to embed and execute a SELECT statement within a Public Function, and assign the value to a variable within a DO...LOOP. But I'd take any other ideas too!
For example, let’s assume you start with a balance of zero and have these annual contributions, which for the sake of argument are obtainable via a table or query:
Year Contribution (at year end)
2009 $100
2010 $125
2011 $150
2012 $175
…
I’m trying to create another query, using that first query as my data source, which would return the following results, assuming a fixed rate of 10% growth per year:
Year Balance (at year end)
2009 $100
2010 $235 [which is $100*1.10 + 125]
2011 $408.50 [which is $235*1.10 + 150]
2012 $624.35 [which is $408.50*1.10 + 175]
…
I’m not really an Access superhero nor SQL/VB guy, but after surfing the blogs, I have tried hacking around with Public Functions, Global Variables, DSUM, embedded Selects, etc., and I just haven’t been be able to figure out a solution [call me stupid!] Any help or advice would be severely appreciated!
P.S. Like many things in Access, there's probably several ways to skin this cat - I just need one! I think I could pull it off if I could figure out how to embed and execute a SELECT statement within a Public Function, and assign the value to a variable within a DO...LOOP. But I'd take any other ideas too!
Comment