Time passed in months

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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.
 

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

Back
Top