I want to use the lesser of two dates to compare to todays date to see if it is more than 10 days overdue. Seems simple enough. I have script that I’ve pieced together from here and there finally working. But since I can’t append my “CheckDate” to a messagebox (even using Cstr) I feel I’m missing something. I get a type mismatch if I try to append Cstr(CheckDate) to a messagebox text.
So I’m searching and searching getting more and more confused on how to handle dates. It seems as if there are so many options … is there a rule of thumb to use for backend classes? Maybe this code is set up all wrong!? Should I not be using NotesItem? Or NotesDateTime?
Any advice or way to simplifiy this in my mind would be greatly appreciated!
Sub Initialize
'...
Dim item As NotesItem
Dim CheckDate As NotesDateTime
Dim tempToday As New NotesDateTime(Today)
'...
While Not (Doc Is Nothing)
'Use the eariler of the two dates to proceed...
If doc.PropMail(0) < doc.PropEff(0) Then
Set item = doc.GetFirstItem( "PropMail" )
Set CheckDate = item.DateTimeValue
Else
Set item = doc.GetFirstItem( "PropEff" )
Set CheckDate = item.DateTimeValue
End If
Call CheckDate.AdjustDay(+10)
'Check if date is more than 10 days overdue from today
difference& = CheckDate.TimeDifference( tempToday )
If difference& > 0 Then
Msgbox "Not Past Due Yet!"
Else
Msgbox "Past Due! "
End If
Set doc = view.getnextdocument(doc)
Wend
End Sub