Date Formula

G

Guest

This is probably a simple question. I have a date field with a formula
"=[hiredate] + 365*2 (I want to add exactly 2 yrs from hiredate). The problem
is, for some of my records the formulated date is exactly 2 years from the
hire date, which is what i want, and some dates are 1 day off. I think this
is because of a leap year or something. I also need to calculate a hiredate +
15 months which also gives me the same problem sometimes. If someone could
help me i would appreciate it,
Thanks
 
G

Guest

Use the DateAdd function to do it for you

=DateAdd("yyyy",2,[hiredate]) ' To add two Years
=DateAdd("m",15,[hiredate]) ' To add 15 months to the date
 
G

Guest

I think you should try using the dateadd function. Try this:
=DateAdd("yyyy", 1, [hiredate])-1 and <= DateAdd("yyyy", 1, [hiredate])=+1

Matt W. said:
This is probably a simple question. I have a date field with a formula
"=[hiredate] + 365*2 (I want to add exactly 2 yrs from hiredate). The problem
is, for some of my records the formulated date is exactly 2 years from the
hire date, which is what i want, and some dates are 1 day off. I think this
is because of a leap year or something. I also need to calculate a hiredate +
15 months which also gives me the same problem sometimes. If someone could
help me i would appreciate it,
Thanks
 
G

Guest

Thats what I needed, Thank you both

Robert_DubYa said:
I think you should try using the dateadd function. Try this:
=DateAdd("yyyy", 1, [hiredate])-1 and <= DateAdd("yyyy", 1, [hiredate])=+1

Matt W. said:
This is probably a simple question. I have a date field with a formula
"=[hiredate] + 365*2 (I want to add exactly 2 yrs from hiredate). The problem
is, for some of my records the formulated date is exactly 2 years from the
hire date, which is what i want, and some dates are 1 day off. I think this
is because of a leap year or something. I also need to calculate a hiredate +
15 months which also gives me the same problem sometimes. If someone could
help me i would appreciate it,
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