Greg,
If the first entered date is considered to be one of the 90 days, then I
believe that it probably should be
dt = DateSerial(Year(dt), Month(dt), Day(dt) + 89)
Otherwise, OK
Many miserable HR departments would be likely to require it be +90 however.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
How about?
Eligibility = DateSerial(Year(HireDate), Month(HireDate) + 4, 1)
You might need to tweak in cases where the hire date *is* the first of the
month.
IOW, say someone is hired on March 1, would this eligibility date then be
June 1 or
July 1? If the former, the full function would be:
Eligibility = _
DateSerial(Year(HireDate), Month(HireDate) + Iif(Day(HireDate) > 1, 4, 3),
1)
Later... Karl
Karl,
Realizing that I am Johnny Come Late in this discussion but wouldn't
the first day of the "next" month following 90 days of employment
require something like this:
Sub FFOnExit()
Dim dt As Date
On Error GoTo Err_Handler
dt = ActiveDocument.FormFields("Text1").Range.Text
dt = DateSerial(Year(dt), Month(dt), Day(dt) + 90)
dt = DateSerial(Year(dt), Month(dt) + 1, 1)
ActiveDocument.FormFields("Text2").Result = dt
Exit Sub
Err_Handler:
MsgBox "Please enter a valid date"
ActiveDocument.FormFields("Text1").Range.Select
End Sub
So if an employee was hired on 12/1/2008, they were employed something
less than 31 full days in Dec, 31 days in Jan, 28 days in Feb. They
completed 90 days employment on 1 March 2009. The first day of the
month after that is 4/01/2009. Could be something for the Labor &
Management Team to work out ;-)