Time passed in months

K

KAnoe

I have the date that a person starts work. I have been asked if I can get it
so the form can tell the user in months how long the person has been working
here. Can I do this?

Access 2003
 
R

Rick Brandt

KAnoe said:
I have the date that a person starts work. I have been asked if I can
get it so the form can tell the user in months how long the person
has been working here. Can I do this?

Access 2003

DateDiff() will give you the difference between two dates, but it counts
barriers crossed. That means that...

DateDiff("m", [YourDateField], Date())

....will give the number of months between your date field and today's date,
but if the start date was November 30, 2006 and you ran that expression on
December 1st it would indicate 1 month even though only one day had passed.

So depending on your needs you might need to get the number of a smaller
increment (like days) between your field and today and make a decision on
how many days you want to count as a month and then divide and round the
result.
 
K

KAnoe

Thanks Rick!

Rick Brandt said:
KAnoe said:
I have the date that a person starts work. I have been asked if I can
get it so the form can tell the user in months how long the person
has been working here. Can I do this?

Access 2003

DateDiff() will give you the difference between two dates, but it counts
barriers crossed. That means that...

DateDiff("m", [YourDateField], Date())

....will give the number of months between your date field and today's date,
but if the start date was November 30, 2006 and you ran that expression on
December 1st it would indicate 1 month even though only one day had passed.

So depending on your needs you might need to get the number of a smaller
increment (like days) between your field and today and make a decision on
how many days you want to count as a month and then divide and round the
result.
 
Top