Date calculation

P

Pete

HI:

Trying to calculate dates in Access, eg DOB 11/15/45, when
will this individual attain age 55? Format I need is as
follows 12/1/2000.

Thanks
 
A

AJ Raiber

Use an unbound text box and enter the formula DateAdd
("yyyy",55,[DOB]).

In this example "YYYY" is the year group you are trying to
add to. you can also add months by using "mm" or Days by
using "d". the 55 is the number you want to add and [dob]
is the field you want to add to. be sure to use the
correct field name inside the square brackets.

Hope this helps.

AJ
 
M

Mary Lou

This was timely - I was trying to do something similar. I
want to add 3 days to a date and have the calculation
populate a field on my form. I typed DateAdd("dd",3,[Date
Received])in the field that I want populated with the new
date (Date Received is the original date, e.g. 10/5/03 + 3
should = 10/8/03 in the field with the calculation.)
However, the field with the calculation only shows #Name?
How can I populate this field on the form? Thanks for your
help.
-----Original Message-----
Use an unbound text box and enter the formula DateAdd
("yyyy",55,[DOB]).

In this example "YYYY" is the year group you are trying to
add to. you can also add months by using "mm" or Days by
using "d". the 55 is the number you want to add and [dob]
is the field you want to add to. be sure to use the
correct field name inside the square brackets.

Hope this helps.

AJ
-----Original Message-----
HI:

Trying to calculate dates in Access, eg DOB 11/15/45, when
will this individual attain age 55? Format I need is as
follows 12/1/2000.

Thanks
.
.
 
A

AJ Raiber

Your formula is correct, however, this does not go into a
field within the table. Instead insert a text field on
your form that is not bound to anything on the table and
insert the formula in the Control Source block in the
properties. This will give you the right answer. Then if
you need to add this into a report you can do it the same
way on the report.

Hope this helps.

AJ

-----Original Message-----
This was timely - I was trying to do something similar. I
want to add 3 days to a date and have the calculation
populate a field on my form. I typed DateAdd("dd",3,[Date
Received])in the field that I want populated with the new
date (Date Received is the original date, e.g. 10/5/03 + 3
should = 10/8/03 in the field with the calculation.)
However, the field with the calculation only shows #Name?
How can I populate this field on the form? Thanks for your
help.

-----Original Message-----
Use an unbound text box and enter the formula DateAdd
("yyyy",55,[DOB]).

In this example "YYYY" is the year group you are trying to
add to. you can also add months by using "mm" or Days by
using "d". the 55 is the number you want to add and [dob]
is the field you want to add to. be sure to use the
correct field name inside the square brackets.

Hope this helps.

AJ
-----Original Message-----
HI:

Trying to calculate dates in Access, eg DOB 11/15/45, when
will this individual attain age 55? Format I need is as
follows 12/1/2000.

Thanks
.
.
.
 
K

Kelvin Lu

Add an equal sign infront of DateAdd. Equations on a form must start with
the equal sign.

Kelvin

Mary Lou said:
This was timely - I was trying to do something similar. I
want to add 3 days to a date and have the calculation
populate a field on my form. I typed DateAdd("dd",3,[Date
Received])in the field that I want populated with the new
date (Date Received is the original date, e.g. 10/5/03 + 3
should = 10/8/03 in the field with the calculation.)
However, the field with the calculation only shows #Name?
How can I populate this field on the form? Thanks for your
help.
-----Original Message-----
Use an unbound text box and enter the formula DateAdd
("yyyy",55,[DOB]).

In this example "YYYY" is the year group you are trying to
add to. you can also add months by using "mm" or Days by
using "d". the 55 is the number you want to add and [dob]
is the field you want to add to. be sure to use the
correct field name inside the square brackets.

Hope this helps.

AJ
-----Original Message-----
HI:

Trying to calculate dates in Access, eg DOB 11/15/45, when
will this individual attain age 55? Format I need is as
follows 12/1/2000.

Thanks
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top