TimeDifference Function to Test for OverDue Doc Sub Initialize If (IsDocOverDue("5/10/2006", 5)=1) Then ' doc is overdue Print "overdue" Else ' doc is not overdue Print "not overdue" End If End Sub Function IsDocOverDue(doclastmoddate As String, numdays As Integer) As Integer ' returns 1 for true if doc is overdue for update ' doclastupdate - should be a field containing last action/update date as string of doc Dim docDT As NotesDateTime ' date of last action on doc Dim compDT As New NotesDateTime(Today) ' today DT adjusted by numdays for comparing passed docDT to todayDT On Error Goto FErrorHandler ' check values passed If (doclastmoddate="" Or numdays=0) Then ' return false, not handling these cases IsDocOverDue=0 Exit Function End If ' set up docDT Set docDT = New NotesDateTime(doclastmoddate) ' test docDT If (docDT Is Nothing) Then ' really bad date passed, return false IsDocOverDue=0 Exit Function End If If (docDT.DateOnly="") Then ' time passed into doc, but not doc, return false IsDocOverDue=0 Exit Function End If ' docDT okay, set up comparison date Set compDT = New NotesDateTime(Today) Call compDT.AdjustDay(numdays * -1) If (docDT.TimeDifferenceDouble(compDT)<0) Then ' document reminder dates passed, return true / 1 IsDocOverDue=1 Else ' document passed reminder period, return false / 0 IsDocOverDue=0 End If Exit Function FErrorHandler: IsDocOverDue=0 Exit Function End Function