Years of Employment

F

Forsi

Hello

I am trying to calculate the years a person is employed by the Company,
taking into account the separation date, current date and hire date. For a
person who is still employed the formula =Int(Date()-[hire date])/365.25
would suffice in giving the current years employed. However, it would not
apply to a person who has left the company and you want to show how many
years of service that this person provided. What formula can I use,
incorporating the the [Separation Date] if it falls before the current date?

I know that this is not correct but I'm listing it to show what I'm thinking.
Years Employed: Int(IIf([Separation Date]<>Date(),Int([Separation
Date]-[Hire Date])/365,Int((Date()-[Hire Date])/365)))

Thanks
Forsi
 
F

Forsi

Hi Douglas

I just wanted to say that this formula works so there is no need to respond.
Apparently, one of the employees had a separation date prior to this year and
I didn't realise it so when I ran the query I misinterpreted the results, as
I was also calculating in my head that the computer should have used the
current date.

No worries. It's good to answer yourself sometimes :)
Forsi
 
R

Roger Carlson

I'm glad you figured out your problem yourself. However, I should mention
there is a built-in function called DateDiff which will give you the
difference between two dates in years, months, weeks, days, hours, seconds,
etc. For your purposes, it would look like this:

=DateDiff("yyyy", [hire date], Date())

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top