Manage Learn to apply best practices and optimize your operations.

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

Dig Deeper on Domino Resources - Part 3

SearchWindowsServer
Search400
  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

SearchDataCenter
SearchContentManagement
Close