Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Date Formula (2002)

    Hi,

    I am using the following formula in a query to find the anniversary date of a user. The Anniversary Date presently calculates to the first day of the month 2 years after the [start date:]

    AnnivDate: DateSerial(Year(DateAdd("yyyy",2,[Start Date])),Month(DateAdd("yyyy",2,[Start Date])),1)

    This working fine. Now I need to find the First day of the month following the anniversary date. So if the [start date] = 1/1/05 and the Anniv. date = 1/1/07 than the date I need to calculate would be 2/1/07.

    I've tried adding +1 into various pieces of the above code but nothing works.

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Formula (2002)

    Try

    DateSerial(Year(DateAdd("yyyy",2,[Start Date])),Month(DateAdd("yyyy",2,[Start Date]))+1,1)

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Date Formula (2002)

    Perfect!!!

    Thanks,
    Leesha

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Date Formula (2002)

    Doesn't this do the same?

    DateSerial(Year([Start Date])+2, Month([Start Date], 1)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Formula (2002)

    As Leesha's original expression? Yes, if you add a closing parenthesis after Month([Start Date]

    And the expression she requested could be

    =DateSerial(Year([Start Date])+2,Month([Start Date])+1,1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •