RE: DateRange Question/Help Kyle S Huang 28.Jun.11 09:58 AM a Web browser Domino Designer -- LotusScript All ReleasesAll Platforms
I think NotesView.GetDocumentByKey is working as intended. You can try getting the first document at the beginning of your date range, then iterate through the view with NotesView.GetNextDocument until you reach the end. Build your return results, or dump them in a temporary folder that you can get formatted or sorted.
In the past, I have used something like NotesDatabase.Search instead of a NotesView.GetDocumentbyKey.
In the NotesDatabase.Search, you can compose in a formula that resembles a view selection formula, and that can give you more flexibility in working with dates. Such as, "(FORM = "myForm") & (DATEFIELD >= [5/1/2011]) & (DATEFIELD <= [6/30/2011])". However, I do not recall if the results sets is sorted nicely, or I had to perform the sorting by using a temporary folder or manually sort it.
For performance, you can perform a full text index and try the NotesDatabase.FTSearch. Note, the syntax is slightly different in the FTSearch--but, you can test your queries from the search bar. For instance, to use a field reference in FTSearch, you need brackets like ([FORM] = "myForm")