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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picking Year Out of a Date

Status
Not open for further replies.

wwr

Programmer
Jul 31, 2001
2
US
I have written a formula and used the DateAdd function to add one year to an employee's hire date(result is @AdjustedDate). Now I need to subtract the
@AdjustedDate year from the current year.

How can I pick off the year from the current date and the
@AdjustedDate so I can subtract these years?

For example, the @AdjustedDate is 05/01/1999
I need to subtract 1999 from 2002 and get "3".

I've checked the FAQs and searched extensively for a way to do this with no luck.

Can anyone help?

Thx
 
Year({@AdjustedDate}) - Year(CurrentDate)

Of course this assumes that the Adjusted Date is less than the current date. If the person was hired yesterday, you'd get a negative return value.

Hope this helps:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top