A
Associates
Hi,
I was wondering if anyone might be able to help me here.
I was trying to get the following code to work but to no avail.
periodofEmployment = DateDiff("m", DateJoined, CurrDate) + DateDiff("md",
DateJoined, CurrDate) / 29 ' returns number of Months
What the code is supposed to work is to work out the different between the
joined date and the current date and returns a number of months. The code
"DateDiff("md", DateJoined, CurrDate) / 29" would give a more accurate
figure. for example, if the joined date falls on 10-Jan-09 and the current
date is 06-Oct-09, it would then return 8.9 months
Apparently, VBA does not like "md" in the second DateDiff. I tried to use
just the "d" but this returns incorrect value.
Any help would be greatly appreciated.
Thank you in advance
I was wondering if anyone might be able to help me here.
I was trying to get the following code to work but to no avail.
periodofEmployment = DateDiff("m", DateJoined, CurrDate) + DateDiff("md",
DateJoined, CurrDate) / 29 ' returns number of Months
What the code is supposed to work is to work out the different between the
joined date and the current date and returns a number of months. The code
"DateDiff("md", DateJoined, CurrDate) / 29" would give a more accurate
figure. for example, if the joined date falls on 10-Jan-09 and the current
date is 06-Oct-09, it would then return 8.9 months
Apparently, VBA does not like "md" in the second DateDiff. I tried to use
just the "d" but this returns incorrect value.
Any help would be greatly appreciated.
Thank you in advance