Get document collections by using date ranges.

This code will execute very efficiently on the web to retrieve collections of documents based off a date range the user specifies. It uses the DateRange class as the key for the view. The view may not be categorized, otherwise inconsistent results will be returned.

Dim dateRange As NotesDateRange
Dim dateTime1 As New NotesDateTime(Cstr(doc.PDRfrom(0)))
Dim dateTime2 As New NotesDateTime(Cstr(doc.PDRto(0)))
Set dateRange = session.CreateDateRange()
Set dateRange.StartDateTime = dateTime1
Set dateRange.EndDateTime = dateTime2
Dim view As NotesView
Set view = db.GetView("DataLU4XMLGen")
Set collect = view.GetAllDocumentsByKey(dateRange, True)

Posted by fbrefere001 on Wednesday October 19, 2005