Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date formula needed

Status
Not open for further replies.

debizabor

MIS
Nov 16, 2001
7
US
I need a formula to have an anniversay date returned basing it on a [date hired] field. Can you help me?
 
You can use the DateAdd function.

= DateAdd("d", 30, [date hired]) would add 30 days to the hired date.

Hope this helps.
 
Thanks for the help! How would I return a date for the present year? i.e. Someone was hired on 01/15/1998. i need the anniversary to return as 01/15/2003 for this year, and 01/15/2003 for next year and so on.
 
Try something like this:

= Format([date hired],"mm/dd") & "/" & Format(Date(),"yyyy")
 
humble...I've been trying for about two days without success to use a Datepart function to extract the month and date of an effective year and calculate an anniversary date based on the current year if the effective date has been more than 365 days. You inadvertantly answered my question with your response and this code works well. Here's my expression:

Anniversary_Date: IIf(DateDiff("d",Date(),[Effective_Date])<-365,Format([Effective_Date],"mm/dd") & "/" & Format(Date(),"yyyy"),[Effective_Date])

Hopefully this may inadvertantly help someone else who might be trying to accoplish the same feat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top