435,395 Members | 2,541 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

# Calculating Anniversary Date

#### ✓ answered by twinnyfo

Jason,

Your question may best belong in a new thread. However, we can quickly provide an answer for this, since it is somewhat related.

In your case, I would recommend using the DateAdd() function, adding a number of Years or Months to the begin date, and then subtracting 1.

Annual Example:
Expand|Select|Wrap|Line Numbers
1. ExpireDate = DateAdd("yyyy", 1, BeginDate) -1
Six-Month Example:
Expand|Select|Wrap|Line Numbers
1. ExpireDate = DateAdd("m", 6, BEginDate) - 1
Hope this hepps!

4 Replies

 Expert Mod 2.5K+ P: 3,284 Jason, Your question may best belong in a new thread. However, we can quickly provide an answer for this, since it is somewhat related. In your case, I would recommend using the DateAdd() function, adding a number of Years or Months to the begin date, and then subtracting 1. Annual Example: Expand|Select|Wrap|Line Numbers ExpireDate = DateAdd("yyyy", 1, BeginDate) -1 Six-Month Example: Expand|Select|Wrap|Line Numbers ExpireDate = DateAdd("m", 6, BEginDate) - 1 Hope this hepps! Feb 24 '19 #2

 P: 2 twinnyfo, Thanks for your quick response and suggestions. I have not yet attempted to use the DateAdd function in the way you proposed. I will give it a shot and reply back. I did figure out a work around using some variations to my existing calculated fields, but your suggestions may be simpler and more elegant. I am finding that working with date calculations that need to factor in (or out as it may be) leap years can be tough, even for Access pros. I wasn't sure if my question would be sufficient for a new thread considering I started this process with the information from a posting by Stewart Ross on this thread. I am new to posting on these forums, please forgive my rookie mistake. Thanks, Jason Feb 24 '19 #3

 Expert Mod 2.5K+ P: 3,284 Using DateAdd() avoids all issues with Leap Years. There are times when date serial can be useful. However, DateAdd() can be easier in most cases. Feb 24 '19 #4

 Expert Mod 15k+ P: 31,494 Beware of posting code samples from a word processor. They typically mangle the quotes into characters that work for the printed word, but do not work in code. This will cause users to have non-working code should they try to copy your samples and post them into their own code. Apr 13 '19 #5