How can I create date functions in an Access database?

H

H Rahim

I want Access to calculate the follow up date which is after 2 weeks and 6
months of the initial date. For example, if the initial date of visit is
08/13/05 then the follow up date 2 weeks from that will be 08/27/05 and six
months from that will be 02/13/05. Is there a function that I can use and if
so where do I put it? I am new to Access.
 
R

Rick Brandt

H said:
I want Access to calculate the follow up date which is after 2 weeks
and 6 months of the initial date. For example, if the initial date of
visit is 08/13/05 then the follow up date 2 weeks from that will be
08/27/05 and six months from that will be 02/13/05. Is there a
function that I can use and if so where do I put it? I am new to
Access.

Check help file topic on the DateAdd() function.
 
R

Rick B

In addition to Rick's response...

Where you put it would depend. Will the dates always be as stated, or will
those simply be default values that may need to change?

If they will always be the ones stated, I would not store them in my table,
I'd simply calculate them using the dateadd() function and display them in
my queries, forms, or reports. This will allow you to simply store the
initial date and display or print the followups.

If the user (when adding the record) will see those dates default in and
will ask the "customer?" if the dates are acceptable, then possible change
them based on the response, I'd be more inclined to save them in your table
and default the value using the dateadd() function.

Post back if you need more help.

Note: You should not use "DATE" as a field name. I'm not saying you did,
but being new, that is a common mistake. Make sure your "initial date"
field is named something more unique. Personally, I never put spaces in my
field names either. I would name it InitialDate if it were me.

Good Luck,
 
Top