Connecting Tech Pros Worldwide Help | Site Map

Find age of employee

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 11th, 2007, 05:15 AM
Scott
Guest
 
Posts: n/a
Default Find age of employee

I have two fields in a query that hold dates. One is DOB, the other is
HireDate. I want to add a field to a query that will take the
employees DOB and based on their hire date, wil display their age in
years and months at the time they were hired. I then need to add a
query field to take the HireDate and TermDate (termination date) to
show their length of tenure with the company.

Thanks-

Scott


  #2  
Old July 11th, 2007, 12:05 PM
teddysnips@hotmail.com
Guest
 
Posts: n/a
Default Re: Find age of employee

On 11 Jul, 06:06, Scott <s...@henryschein.comwrote:
Quote:
I have two fields in a query that hold dates. One is DOB, the other is
HireDate. I want to add a field to a query that will take the
employees DOB and based on their hire date, wil display their age in
years and months at the time they were hired. I then need to add a
query field to take the HireDate and TermDate (termination date) to
show their length of tenure with the company.
Read up on DateDiff.

To get the age of the employee in years at the date of hire :

SELECT DateDiff("yyyy", DOB, Hired) as StartAge
FROM Table1;

The rest is left as an exercise for the reader.

Edward

  #3  
Old July 11th, 2007, 03:05 PM
Larry Linson
Guest
 
Posts: n/a
Default Re: Find age of employee

<teddysnips@hotmail.comwrote
Quote:
Read up on DateDiff.
>
To get the age of the employee in years at the date of hire :
>
SELECT DateDiff("yyyy", DOB, Hired) as StartAge
FROM Table1;
Read up on DateDiff.

From the immediate window:

? DateDiff("y",#12/31/2000#,#01/01/2001#)
1

By normal reckoning, a baby born on the 31st of December is not one year old
the next day.

? DateDiff("yyyy",#12/31/2000#,#01/01/2007#)
7

According to most cultures, a person born the 31st of December 2000 will not
be 7 years old until the 31st of December 2007.

Yes, there are cultures in which the child is considered age 1 at the moment
of birth. Is your culture one of those? But, in any case, the simplistic
calculation you show is not accurate for that view either.

There is a Knowledge Base article on calculating age at
http://support.microsoft.com/kb/100136/en-us which takes the date within the
year into account.


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.