calculating maturity dates..

  • Follow


i have here for my database some investments...
and then, for every investment, there are different terms which the user will
choose from...
either days, months, or years.. and then i want the maturity date to be
calculated using what the user had inputted...
for example       he indicates 3 months, the starting date is Feb 28, 2007, i
want the maturity date to be calculated as May 30, 2007... how is this
possible? and for years, if example Feb 28, 2007 to Feb 29, 2008?

Please...i really need a help on this...thank you verymuch....

-- 
ai®

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200711/1

0
Reply ai_enjoi 11/23/2007 7:20:55 AM

I would have a table that contains the "terms" of the investment and the 
appropriate interval parameters from the DateAdd function (I'd actually 
probably use this table as the datasource for the users selection of the 
term).  So tbl_InvestTerms would have contain two columns and have values 
like "yyyy", "Years", "q", "Quarters", "m", "Months", "d", "Days".  This 
table would be the datasource for cbo_InvestTerm, where you would display 
the second column but store (bind) the first column.

Then, in your query, you would create a MaturityDate column similar to:

MaturityDate: DateAdd([Term], [TimePeriods], [StartDate])

HTH
Dale


"ai_enjoi via AccessMonster.com" <u33509@uwe> wrote in message 
news:7ba1b990c7af4@uwe...
>i have here for my database some investments...
> and then, for every investment, there are different terms which the user 
> will
> choose from...
> either days, months, or years.. and then i want the maturity date to be
> calculated using what the user had inputted...
> for example       he indicates 3 months, the starting date is Feb 28, 
> 2007, i
> want the maturity date to be calculated as May 30, 2007... how is this
> possible? and for years, if example Feb 28, 2007 to Feb 29, 2008?
>
> Please...i really need a help on this...thank you verymuch....
>
> -- 
> ai�
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200711/1
> 


0
Reply Dale 11/26/2007 2:09:52 AM


Good suggestion, Dale.  In fact why bother with a table, simply code the 
values directly into a list or combo box?

Rod
0
Reply Utf 11/26/2007 3:58:00 AM

Rod,

I hate to "simply code the values directly into a list" primarily because it 
is so easy to forget what you've done and have to go looking.

Personally, I prefer to have tables behind all of my bound controls. 
Especially if there is any chance the the values will be used in more than 
one place.  I cannot think of a single case in the last 5 years where I have 
hard-coded values in a combo or list box.

Dale

"Rod Plastow" <RodPlastow@discussions.microsoft.com> wrote in message 
news:BF1C7424-DDBD-46A9-9C5C-3B4D4644C2F2@microsoft.com...
> Good suggestion, Dale.  In fact why bother with a table, simply code the
> values directly into a list or combo box?
>
> Rod 


0
Reply Dale 11/26/2007 10:48:46 PM

Hi Dale,

I agree in principle but in this case the text strings - "yyyy", "mm", etc. 
will not change.  Once coded it is unlikely you need to revisit the control.

Rod
0
Reply Utf 11/27/2007 1:59:01 AM

Rod,

This is just a personal preference thing.  I like to have "all" of my data 
in tables.

Dale

"Rod Plastow" <RodPlastow@discussions.microsoft.com> wrote in message 
news:367C2C74-2A6C-43CD-A259-C9B24A737110@microsoft.com...
> Hi Dale,
>
> I agree in principle but in this case the text strings - "yyyy", "mm", 
> etc.
> will not change.  Once coded it is unlikely you need to revisit the 
> control.
>
> Rod 


0
Reply Dale 11/27/2007 2:49:23 AM

5 Replies
1231 Views

(page loaded in 1.32 seconds)


Reply: