Results 1 to 7 of 7
  1. #1
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156

    Anniversary date

    I am trying to set up an anniversary date field. This meaning 365 days from todays date. How would I go about doing this?

    Thank-you

    Cheeco

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    annDate = dateadd("yyyy",1,[MyDate])

  3. #3
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    Ok. Where do I put that peice of code Ranman256.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    in a query :dateadd("yyyy",1,[MyDateField])
    or
    in a form:
    =dateadd("yyyy",1,txtBoxDate)

  5. #5
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    OK I don't think I was clear as to what I was looking to do. I apologize for that. I have a start date in a field for a member. I also have a field for a anniversary date. Say I put in today's date as a start date. What is want to do is have the anniversary date automatically set to one year from today's date according to the date I out in as a start date. I did try both the form and the query and I could not get either to work. I am using Access 2016.

  6. #6
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Don't store this date, calculate it from your start date - otherwise you will have to recalculate it every time the anniversary date passes.

    So in the query you make a calculated field
    Code:
    AnniveraryDate: IIf(DateSerial(Year(Date()),Month([YourStartDate]),Day([YourStartDate]))<Date(),DateSerial(Year(Date()),Month([YourStartDate]),Day([YourStartDate])),DateSerial(Year(Date())+1,Month([YourStartDate]),Day([YourStartDate])))
    This should work at any time of the year (provided I've counted the brackets up properly...)
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    It is working. Thanks for all the help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-20-2018, 11:57 PM
  2. Reset Field Value On Anniversary Date
    By breakingme10 in forum Access
    Replies: 33
    Last Post: 02-23-2017, 03:29 PM
  3. Replies: 3
    Last Post: 07-09-2015, 02:15 PM
  4. Sum After Anniversary Date
    By vinsavant in forum Access
    Replies: 3
    Last Post: 02-18-2013, 07:02 PM
  5. Replies: 3
    Last Post: 08-21-2012, 03:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums