Function IsDocOlderThan(doclastmoddate As String, numdays As Integer) As Integer ' returns 1 for true if doc is older than numdays ' 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 IsDocOlderThan=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 IsDocOlderThan=0 Exit Function End If If (docDT.DateOnly="") Then ' time passed into variable, but not date, return false IsDocOlderThan=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 cutoff date passed - older, return true / 1 IsDocOlderThan=1 Else ' document newer than cutoff period, return false / 0 IsDocOlderThan=0 End If Exit Function FErrorHandler: IsDocOlderThan=0 Exit Function End Function __________________________ Function IsDocOlderThan(doclastmoddate As String, compDT As NotesDateTime) As Integer ' returns 1 for true if doc is older than date in compDT ' doclastupdate - should be a field containing last action/update date as string of doc ' compDT - date should be older than Dim docDT As NotesDateTime ' date of last action on doc On Error Goto FErrorHandler ' check values passed If (doclastmoddate="" Or compDT Is Nothing) Then ' return false, not handling these cases IsDocOlderThan=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 IsDocOlderThan=0 Exit Function End If If (docDT.DateOnly="") Then ' time passed into variable, but not date, return false IsDocOlderThan=0 Exit Function End If ' docDT okay, set up comparison date If (docDT.TimeDifferenceDouble(compDT)<0) Then ' document cutoff date passed - older, return true / 1 IsDocOlderThan=1 Else ' document newer than cutoff period, return false / 0 IsDocOlderThan=0 End If Exit Function FErrorHandler: IsDocOlderThan=0 Exit Function End Function