Deterimine If A Date Is Within A Daterange
Here is an easy way to determine of a NoteDateTime value falls within a
NotesDateRange.
Function IsInDateRange( StartDT As NotesDateTime, EndDT As NotesDateTime,
dtval As NotesDateTime)
Dim diffstart As Long
Dim diffend As Long
Dim range As Long
range = enddt.TimeDifference(startdt)
diffstart = dtval.TimeDifference(startdt)
diffend = dtval.TimeDifference(enddt)
If range < 0 Then
Msgbox "Invalid Date Range"
IsInDateRange = False
End
End If
If diffstart > 0 Then
If diffend < 0 Then
Msgbox dtval.LocalTime &" is IN the specified rage"
IsInDateRage = True
Elseif diffend > 0 Then
Msgbox dtval.LocalTime &" is AFTER the specified rage"
IsInDateRage = False
End If
Elseif diffstart < 0 Then
Msgbox dtval.LocalTime &" is BEFORE the specified rage"
IsInDateRage = False
End If
End Function