Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Date Formula

Discussion in 'Information Technology' started by Matt W., Nov 17, 2005.

Tags:
  1. Matt W.

    Matt W.
    Expand Collapse
    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
     
  2. Loading...

    Similar Threads Forum Date
    Self Update On The Gurdwara Blogs Apr 3, 2017
    Sikh News BREAKING: Young Sikh Shot Dead In Jalalabad, Afghanistan . - Sikh24 News & Updates Breaking News Oct 2, 2016
    Sikh News Sikh Candidate In Hamilton Disgusted By Racist Vandalism - Newstalk ZB Breaking News Aug 22, 2016
    Sikh News Amit Jani: Trump Leverages Fear In Americans, Wrong Candidate For Our Nation's Future Breaking News Feb 18, 2016
    Update Blogs Oct 16, 2015

  3. OP
    Ofer

    Ofer
    Expand Collapse
    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
    --
    I hope that helped
    Good Luck


    "Matt W." wrote:

    > 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
     
  4. OP
    Robert_DubYa

    Robert_DubYa
    Expand Collapse
    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." wrote:

    > 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
     
  5. OP
    Matt W.

    Matt W.
    Expand Collapse
    Guest

    Thats what I needed, Thank you both

    "Robert_DubYa" wrote:

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

    >
    > "Matt W." wrote:
    >
    > > 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
     
Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     


Share This Page